Energizeer
New member
- Joined
- Jan 19, 2007
- Messages
- 2
- Programming Experience
- 1-3
Hello,
I'm new to VS 2005 and have been learning for only a few weeks so please forgive me if I seem like a newbie.
I got a number of Videos from LearnVisualStudios.net and they walked me through the drag and drob database set up. I have datagrids which work well and display the data just fine. The thing is, I want to customize the layout of the way the data is shown and edited. I have read many articles about the subject and am now pretty familiar with ADO.NET and all that. However, much of the info I have found doesn't apply to my set up in VS.NET.
VS set up my dataset and the contained DataTables and Table adapters for me. Basically all I want to do is set the text in a textbox or label to a field in my database. This is the code I was trying to use:
Dataset1s intelisence doesn't give me a Tables option so this code won't work.
From what I have learned, VS uses Typed DataSets which don't seem to have the .Tables method like the old ADO.
I have now tried the following:
But I get an error that there is no row at position 0.
I would really appreciate some help on this matter,
Thanks.
P.S. Please don't tell me to read a Book. I don't have access to a VS.NET book at the moment. Thanks
I'm new to VS 2005 and have been learning for only a few weeks so please forgive me if I seem like a newbie.
I got a number of Videos from LearnVisualStudios.net and they walked me through the drag and drob database set up. I have datagrids which work well and display the data just fine. The thing is, I want to customize the layout of the way the data is shown and edited. I have read many articles about the subject and am now pretty familiar with ADO.NET and all that. However, much of the info I have found doesn't apply to my set up in VS.NET.
VS set up my dataset and the contained DataTables and Table adapters for me. Basically all I want to do is set the text in a textbox or label to a field in my database. This is the code I was trying to use:
VB.NET:
textBox1.Text = DataSet1.Tables["MainTable"].Rows[0].ItemArray[2].ToString();
Dataset1s intelisence doesn't give me a Tables option so this code won't work.
From what I have learned, VS uses Typed DataSets which don't seem to have the .Tables method like the old ADO.
I have now tried the following:
VB.NET:
DataSet1 NewDataSet = new DataSet1();
String Testout = NewDataSet.MainTableTBL.Rows[0].ItemArray[0].ToString();
TextBox1.Text = Testout;
But I get an error that there is no row at position 0.
I would really appreciate some help on this matter,
Thanks.
P.S. Please don't tell me to read a Book. I don't have access to a VS.NET book at the moment. Thanks