Update Database Problem ??? Ergent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I create a sql server ce table and manage to insert some value into the table create. But when I try to update it does not update the data source.

I try to delete the row, but it does not work ???

Can anyone help
 
Hi,
more details would help, and you may be better going to the Quickstart
Tutorials at http://samples.gotdotnet.com/quickstart/CompactFramework/ where
there is vb.net and c# code for databases.

But, update would be done similar to...

Dim SqlCmd as SqlCeCommand
Dim Sql as string

Sql = "Update mytable set myvalue = 1 where myvalue = 0"
SqlCmd = New SqlCeCommand(Sql, sqlCeConn)
SqlCmd.CommandType = CommandType.Text
Try
SqlCmd.ExecuteNonQuery()
Catch ex As SqlCeException
DisplaySQLCEErrors(ex, Sql)
End Try
SqlCmd.Dispose()
HTH

Pete

--
Pete Vickers
Microsoft Windows Embedded MVP
HP Business Partner
http://www.gui-innovations.com

HONG said:
I create a sql server ce table and manage to insert some value into the
table create. But when I try to update it does not update the data source.
 
Hi,

You need to call DataAdapter.Update() to transmit the changes cached in
DataSet to the database.

Thanks,
Amy

--------------------
| From: "Pete Vickers [eMVP]" <pete at gui - innovations dot com>
| References: <[email protected]>
| Subject: Re: Update Database Problem ??? Ergent
| Date: Wed, 10 Mar 2004 11:49:15 -0000
| Lines: 39
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: cpc2-bolt4-3-0-cust92.mant.cable.ntl.com 81.110.31.92
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:48167
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi,
| more details would help, and you may be better going to the Quickstart
| Tutorials at http://samples.gotdotnet.com/quickstart/CompactFramework/
where
| there is vb.net and c# code for databases.
|
| But, update would be done similar to...
|
| Dim SqlCmd as SqlCeCommand
| Dim Sql as string
|
| Sql = "Update mytable set myvalue = 1 where myvalue = 0"
| SqlCmd = New SqlCeCommand(Sql, sqlCeConn)
| SqlCmd.CommandType = CommandType.Text
| Try
| SqlCmd.ExecuteNonQuery()
| Catch ex As SqlCeException
| DisplaySQLCEErrors(ex, Sql)
| End Try
| SqlCmd.Dispose()
| HTH
|
| Pete
|
| --
| Pete Vickers
| Microsoft Windows Embedded MVP
| HP Business Partner
| http://www.gui-innovations.com
|
| | > I create a sql server ce table and manage to insert some value into the
| table create. But when I try to update it does not update the data source.
| >
| > I try to delete the row, but it does not work ????
| >
| > Can anyone help
|
|
|
 
If it's still not working, please post your code snippet and let's figure
out what is wrong.

Thanks,
Amy

--------------------
| Thread-Topic: Update Database Problem ??? Ergent
| thread-index: AcQM8Xh2j8VMFrysSlGsqmkpbqzC9A==
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| From: "=?Utf-8?B?SE9ORw==?=" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Update Database Problem ??? Ergent
| Date: Thu, 18 Mar 2004 06:01:12 -0800
| Lines: 1
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:48900
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I've try but it does not work ???
|
 
Back
Top