D
DaBrain
I can use some help here.
I have been moving from Delphi/C++ Win32 Database Development (ADO) to
C#.Net /ADO.NET the language is not the problem ADO.NET is however
kicking my butt.
I finally get the true power and purpose of a Dataset, wow, that was a
light bulb Not easy when you are still thinking ADO RecordSets almost
got the basics down, , NOT! From what i have read so far, this is a
hurdle for lots of coders.
I have developed a tiny little DB program against SQL Server to test my
skills and all works fine, then I try the most mundane and simple of
tasks and realize I have no clue what I'm doing.
The Simple Problem (Made Small):
I have a DataGrid and a Button I click the button and I want it to
update the current record (Currently Selected in the Grid) Lets say,
update the Field/Colum Named "Price" to 19.95
Old School Delphi
MyTable.Edit;
MyTable.FieldByName("PRICE").Value := 19.95
MyTable.Post;
// ^This would have edited the CURRENT Record.
The Question
How do I Access the "Current" Active Record in a DataGrid
Programmatically and Update one of the fields Programmatically
My Guess is something Like
MyDataSet.Tables[0].SOMETHING // IM LOST HERE
By Asking this question I hope to:
1) learn How To Access DataSet's Table Members BY Column Name and
update the value Programmatically.
2) Find out whether or not ADO.NET even knows what the current active
Record is in my DataSet
I am a good coder, i just need the light bulb to go on- I need that
moment to happen.
My Head is Stuck In something like this:
MyDataSet.Tables[0].Edit;
MyDataSet.Tables[0].Field("PRICE") = 19.95
MyDataSet.Tables[0].Post;
I have been moving from Delphi/C++ Win32 Database Development (ADO) to
C#.Net /ADO.NET the language is not the problem ADO.NET is however
kicking my butt.
I finally get the true power and purpose of a Dataset, wow, that was a
light bulb Not easy when you are still thinking ADO RecordSets almost
got the basics down, , NOT! From what i have read so far, this is a
hurdle for lots of coders.
I have developed a tiny little DB program against SQL Server to test my
skills and all works fine, then I try the most mundane and simple of
tasks and realize I have no clue what I'm doing.
The Simple Problem (Made Small):
I have a DataGrid and a Button I click the button and I want it to
update the current record (Currently Selected in the Grid) Lets say,
update the Field/Colum Named "Price" to 19.95
Old School Delphi
MyTable.Edit;
MyTable.FieldByName("PRICE").Value := 19.95
MyTable.Post;
// ^This would have edited the CURRENT Record.
The Question
How do I Access the "Current" Active Record in a DataGrid
Programmatically and Update one of the fields Programmatically
My Guess is something Like
MyDataSet.Tables[0].SOMETHING // IM LOST HERE
By Asking this question I hope to:
1) learn How To Access DataSet's Table Members BY Column Name and
update the value Programmatically.
2) Find out whether or not ADO.NET even knows what the current active
Record is in my DataSet
I am a good coder, i just need the light bulb to go on- I need that
moment to happen.
My Head is Stuck In something like this:
MyDataSet.Tables[0].Edit;
MyDataSet.Tables[0].Field("PRICE") = 19.95
MyDataSet.Tables[0].Post;