Need help Updating SQL Server Express DB from c# :(


Posted on 16th Feb 2014 07:03 pm by admin

Please can anyone help with:-
1 How to sructure the strSelect statement.
2 How to instruct the cn, da, cb, tb etc to go and get on with it.

Extra info: gl_Dataset.ds is a dataset that is in an object that is created in the forms designer.cs
and is then global to all code on this form. This setup works because I can read and display the data.
colErrByUserID is not PK but all columns in table were selected when gl_Dataset.ds was created.


private void btnSaveAllChangesMadeToAllLogsSoFar_Click(object sender, EventArgs e)
{
string strSelect = "UPDATE INTO dbo.tblQLs WHERE colErrByUserID = '" +
LoginForm.gb_strUserID + "' ";

SqlConnection cn = new SqlConnection(LoginForm.gb_strConnection);
SqlDataAdapter daTblQLs = new SqlDataAdapter(strSelect, LoginForm.gb_strConnection);
SqlCommandBuilder cb = new SqlCommandBuilder(daTblQLs);

cb.GetUpdateCommand();
daTblQLs.Update(gl_Dataset.ds, "tblQLs");

cn.Close();
}

Thank you for your help.

No comments posted yet

Your Answer:

Login to answer
87 Like 34 Dislike
Previous forums Next forums
Other forums

upload image name with extension using php
hi frds..

<input id="file1" type="file" name="file[]" &a

Filling gaps in dates
So i'm doing a query for sales data and my return array looks like this

('date' => '20

convert PHP array to Javascript array
I have a page that gets a request sent from AJAX, and I am trying to convert a PHP array to a javasc

Transform value 0 in no and 1 in yes help needed
Hello,
I have this in the table: "value" type int 0 to represent false and 1 to represe

Delete Client 066 Earlywatch
Hi all,

in former times client earlywatch was required for SAPs remote access to SAP inst

distinct rows
Hi
version 10.2.0.3

I have a query output something like the following

ID

constructor ?
i have written this program and made 3 constructors in the class and i want to call them in the main

Problem executing bash script using shell_exec
Hi there,
I created a bash script file using following code to convert doc documents to pdf using

mysql_query returning boolean instead of mysql ressource
Hi,

I seem to have a weird issue with the php command mysql_query. I pass 2 arguments the que

Xacute search within SQL results
I have a query that is pulling data, and I want to return a specific value from the results of that

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash