TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dean
NA
3
0
How do you make a data table accessible anywhere in a Visual C# 2008 Express project?
Mar 28 2009 3:15 AM
I'm currently putting together a desktop application and trying to make a data table (called DT_series) that's declared in my startup class (main) accessible to any other forms in the project. This is what I've declared in main:
namespace RMA
{
public partial class Main : Form
{
public DataTable DT_series;
.......
public Main()
{
InitializeComponent();
DT_series = new DataTable();
............
and in another form, I have, for example, this section of code that fills the table with something:
Main.DT_series = dbobj.GetSeries((string)this.lstDrvMan.SelectedValue);
There are no build errors, but when I run the code, it crashes at the above line with this error:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
It's complaining about the existence of DT_series, but I thought that the way I declared it in main, it's public, and instantiated, so the other form should be able to talk to it. Can anyone tell me where I've gone wrong? Thanks.
Reply
Answers (
1
)
How do I get PasswordHash value?
Access is denied in Process.GetProcesses()