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.

Did you know?Explore Trending and Topic pages for more stories like this.
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

Kill a process
I have a question - how can I kill a process from a command line or by using Oracle SQL Developer? I

C problem struct and string
Hi guys,

This is my first post and I'm hoping the experts here can help me solve my problem.<

Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop

php and downloading
I want to use a php script to create two files. Then I want it to redirect (or whatever) to have tho

TCP Sending Unsigned Char...
Hi...

I want to send over tcp/ip some data, i have the data in hexadecimal, and when i tr

=> and <=
So I was digging through some code when I came across the <= operator. This is the first tim

pull content
I have an existing page, domain/adverts.php which has a good PR. I've just rebuilt my site and the n

Please help understand this code
I noticed the index page on my site was modified this morning and found this code inserted at the bo

mail with attachment problems
Hi. I have the following code:
Code: else if(file_exists("site".$timp.".zip")

Retrieving Data from Two Different Databases
Hello All,

Ran into another problem and would appreciate some help! I have two datab

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