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

php is not recognized as an internal or external command
Hello,

I am trying to bake the code in CakePHP through my console.
I have changed my Path

PHP/PKI
I am trying to set up a web application that uses pki. does anyone have a good tutorial to set this

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

Grabbing Values From an Array for Posting
I have a grid array that I am using with a form that when it hits the currently named test.php it lo

Auto-populating dropdowns and multiple forms.
Here's what I have so far:

First drop down = select a state (works)
This populates the sec

Procedural to OOP
John Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pr

Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a s

Using unserialize()
Hi there.

I have some data in my database that is serialized.

e.g.

a:2:{i:0

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