Advertisement

06.21.2005 at 05:57AM PDT, ID: 21465354
[x]
Attachment Details

Update database from datagridview

Asked by mhedrick in Microsoft Visual Basic.Net

Tags: datagridview, update, database

Hello,
I am trying to update ab SQL  database from a datagridview.
My question is that the grid may have 16 columns and 2 or more rows.
Can I just update the dataset

        Dim griddataset As DataSet = New DataSet
        Dim Savedatagridadapter As New SqlDataAdapter
        Savedatagridadapter.SelectCommand = New SqlCommand

        Savedatagridadapter.UpdateCommand.Connection = objconnection ' New SqlConnection("server = dev2003;database= tp;" & "user ID =      
        sa;password = someword;")
     '   Savedatagridadapter.UpdateCommand.CommandText = ("invCreateInvdetpRecord")
    '    Savedatagridadapter.UpdateCommand.CommandType = CommandType.StoredProcedure
        Savedatagridadapter.UpdateCommand.Parameters.Add("griddatset")

I have a stored procedure to update the records but will I have to assign a value to each column?
 Savedatagridadapter.Parameters.Add(New System.Data.SqlClient.SqlParameter("@order", System.Data.SqlDbType.VarChar, 11, "order"))

I just want to be able to update the database with the changes the user makes to the datagridview.
I have used vb for years but nre to vb.net so go easy on the old fellor.
Thanks for your help and thoughts.
Cheers
Mike

Start Free Trial
[+][-]06.21.2005 at 06:05AM PDT, ID: 14265479

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: datagridview, update, database
Sign Up Now!
Solution Provided By: RonaldBiemans
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.21.2005 at 06:13AM PDT, ID: 14265536

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.21.2005 at 06:25AM PDT, ID: 14265636

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.21.2005 at 06:42AM PDT, ID: 14265767

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.21.2005 at 07:15AM PDT, ID: 14266072

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.21.2005 at 07:41AM PDT, ID: 14266342

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.21.2005 at 08:08AM PDT, ID: 14266656

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.21.2005 at 08:09AM PDT, ID: 14266663

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.21.2005 at 08:14AM PDT, ID: 14266718

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.21.2005 at 11:59PM PDT, ID: 14272981

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 12:04AM PDT, ID: 14273000

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 05:26AM PDT, ID: 14274423

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 05:50AM PDT, ID: 14274595

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 07:53AM PDT, ID: 14275777

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 07:59AM PDT, ID: 14275844

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 08:11AM PDT, ID: 14275994

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 08:21AM PDT, ID: 14276110

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 08:35AM PDT, ID: 14276286

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 08:36AM PDT, ID: 14276309

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 09:55AM PDT, ID: 14277122

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.22.2005 at 01:05PM PDT, ID: 14278973

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32