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

Text file to .Dat file Conversion in PHP
Hi All,
Could anybody provide code for Text file to .Dat file Conversion in PHP.

Tha

Logic question
im wondering what's the best method to do the above list:

it is for alliance @ MMORPG game

rename the file
File.txt

Code: ***DOCUMENT***
..DN:
000044255
..CB:
..SN:
..PY:
2009
..E

MSSQL/PHP
I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which

Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga

update post issues
I am trying to create an update to a post function, while the update does occur, the page routing an

SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum

DateObject and Nulls
Hi all,

I have an array mapped to a value object. One of the items in the array is a PHP Date

Problem with passing variables
I'm not really a php programmer so I'm really struggling with this issue.

I have a banner s

a multi dimensional array with for each
hi, I have been asked to write an array, I have Zone 2,3,4,5,6,7,8 each zone has 3 sections of weigh

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