Click here to Skip to main content
15,896,118 members
Home / Discussions / Database
   

Database

 
GeneralRe: Is there a way to extract a value/result when you exec a sql string Pin
Christian Graus14-Feb-08 13:12
protectorChristian Graus14-Feb-08 13:12 
GeneralRe: Is there a way to extract a value/result when you exec a sql string Pin
andyharman14-Feb-08 21:54
professionalandyharman14-Feb-08 21:54 
GeneralBCPutility - Unable to open BCP host data-file Pin
#realJSOP14-Feb-08 6:34
professional#realJSOP14-Feb-08 6:34 
GeneralRe: BCPutility - Unable to open BCP host data-file Pin
Mike Dimmick14-Feb-08 12:44
Mike Dimmick14-Feb-08 12:44 
GeneralRe: BCPutility - Unable to open BCP host data-file Pin
#realJSOP16-Feb-08 0:24
professional#realJSOP16-Feb-08 0:24 
GeneralUsing xp_cmdshell [SOLVED] Pin
#realJSOP14-Feb-08 4:53
professional#realJSOP14-Feb-08 4:53 
GeneralOne to Many Atomic Update Pin
Brady Kelly14-Feb-08 1:32
Brady Kelly14-Feb-08 1:32 
QuestionUpdate a datatable to database Pin
Bluebamboo14-Feb-08 1:02
Bluebamboo14-Feb-08 1:02 
Hi guys,

I got a datatable from a excel file, and try to update this table onto sql server, in other words, the users can change the table in sql server based on excel file.

I use SqlDataAdapter to update the table, but the problem is no change happen on my database.


<br />
'...<br />
<br />
Dim cmdSql As SqlCommand = New SqlCommand<br />
cmdSql.Connection = connSql<br />
cmdSql.CommandText = "UPDATE pfSchool SET notes = @notes WHERE ID = @id"<br />
<br />
cmdSql.Parameters.Add(New SqlParameter("@notes", SqlDbType.NText))<br />
cmdSql.Parameters("@notes").SourceColumn = "notes"<br />
<br />
cmdSql.Parameters.Add(New SqlParameter("@id", SqlDbType.Int))<br />
cmdSql.Parameters("@id").SourceColumn = "ID"<br />
<br />
' modify the data for testing<br />
dtData.Rows(0)("notes") = "test2"<br />
<br />
Dim daSql As SqlDataAdapter = New SqlDataAdapter<br />
daSql.UpdateCommand = cmdSql<br />
daSql.UpdateCommand.Connection.Open()<br />
<br />
daSql.Update(dtData)<br />
<br />
'...<br />


Above is a piece of codes which i made for testing.

Any suggestion would be appreciated!

Ming
GeneralRe: Update a datatable to database Pin
Joe14-Feb-08 1:27
Joe14-Feb-08 1:27 
GeneralRe: Update a datatable to database Pin
Bluebamboo14-Feb-08 4:32
Bluebamboo14-Feb-08 4:32 
GeneralRe: Update a datatable to database Pin
Joe14-Feb-08 5:30
Joe14-Feb-08 5:30 
GeneralRe: Update a datatable to database Pin
Bluebamboo14-Feb-08 8:41
Bluebamboo14-Feb-08 8:41 
GeneralRe: Update a datatable to database Pin
Joe14-Feb-08 18:48
Joe14-Feb-08 18:48 
GeneralPassing Parameters to Strored Procedure Pin
dnsl13-Feb-08 23:36
dnsl13-Feb-08 23:36 
GeneralRe: Passing Parameters to Strored Procedure [modified] Pin
Vimalsoft(Pty) Ltd14-Feb-08 20:13
professionalVimalsoft(Pty) Ltd14-Feb-08 20:13 
GeneralRe: Passing Parameters to Strored Procedure Pin
Ashfield15-Feb-08 9:48
Ashfield15-Feb-08 9:48 
Generalerror in local works fine in server Pin
new2pgrmg13-Feb-08 23:21
new2pgrmg13-Feb-08 23:21 
GeneralRe: error in local works fine in server Pin
Joe14-Feb-08 0:03
Joe14-Feb-08 0:03 
GeneralRe: error in local works fine in server Pin
new2pgrmg14-Feb-08 1:13
new2pgrmg14-Feb-08 1:13 
GeneralSaving Image Pin
mwanyu13-Feb-08 21:11
mwanyu13-Feb-08 21:11 
GeneralRe: Saving Image Pin
Giorgi Dalakishvili13-Feb-08 22:43
mentorGiorgi Dalakishvili13-Feb-08 22:43 
Generalreplace '1/1/1900' to NULL in MS SQL Pin
John Sundar13-Feb-08 20:39
John Sundar13-Feb-08 20:39 
GeneralRe: replace '1/1/1900' to NULL in MS SQL Pin
Colin Angus Mackay13-Feb-08 21:11
Colin Angus Mackay13-Feb-08 21:11 
GeneralIncluding MSSQL in a C# application for a client. Pin
AlainMesias13-Feb-08 15:51
AlainMesias13-Feb-08 15:51 
Generalcopy datarow Pin
Smithers-Jones13-Feb-08 10:01
Smithers-Jones13-Feb-08 10:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.