How to add new records through dataset and how to edit,update that records through dataset.and also how can i update that new records to database.iam using asp,net with vb.net
edit records through dataset
Collapse
X
-
Tags: None
-
-
Originally posted by DrBunchmanbharathi228,
Please don't ask questions here that can be easily researched in books or online. Check out these links and if you have any specific problems with your code then our experts will be happy to help.
Dr B
MODERATOR
thanks for u r reply.but that links are not useful for me.already iam searching in online and google.thats why i put question here.Comment
-
Okay, so why aren't any of those useful to you? There's a few different examples there showing you how updating a dataset can be done.
Have you tried anything so far? If so print your code here and I'll take a look.
Dr BComment
-
this code for adding records through datasetOriginally posted by DrBunchmanOkay, so why aren't any of those useful to you? There's a few different examples there showing you how updating a dataset can be done.
Have you tried anything so far? If so print your code here and I'll take a look.
Dr B
its working fine.then i can update this new records with databaseCode:Dim da As New SqlDataAdapter("select * from calc_limit_config", con) con.Open() da.Fill(ds, "calc_limit_config") con.Close() Dim drnew As Data.DataRow drnew = ds.Tables("calc_limit_config").NewRow With drnew .Item("param") = TextBox1.Text .Item("alarm") = TextBox2.Text .Item("limit") = TextBox3.Text End With ds.Tables(0).Rows.Add(drnew)
then i want edit(or)update that particular new recordsCode:Dim cb As New SqlCommandBuilder(da) da.UpdateCommand = cb.GetUpdateCommand() da.Update(ds, "calc_limit_config")
here the error isCode:drnew = ds.Tables("calc_limit_config").Select("param = '1') drnew(0)("alarm") =textbox2.text drnew(0)("limit") =textbox3.text
value of type 1-dimentional array of system.data.dat arow cannot be converted to system.data.dat arowLast edited by DrBunchman; Jul 29 '08, 08:11 AM. Reason: Added [Code] Tags - Please use the '#' buttonComment
-
We have two articles in our howtwos section called Howto Use a Database in your .NET Program. Please read them.Comment
Comment