PC Review


Reply
Thread Tools Rate Thread

SQL Mobile Field Content

 
 
Beebs
Guest
Posts: n/a
 
      28th Jun 2006
How can I get the contents of a field in SQL Mobile. I've just
switched over from doing ADOCE projects so I'm quite clueless.

For instance, I use to be able to do this:

rs.Open(sqlString)
If Not rs.EOF And Not rs.BOF Then
If variable1 <> rs.Fields("Field1").Value.ToString() Then
'Do something
Else
'Do something
End If
End If
rs.Close()

In SQL Mobile programming, I can't even figure out how to tell if
there is a record in the query I set up in code. Can anyone give me
some minor assistance with this?

Thanks
 
Reply With Quote
 
 
 
 
Ilya Tumanov [MS]
Guest
Posts: n/a
 
      28th Jun 2006
Sample from
http://msdn2.microsoft.com/en-us/lib...atareader.aspx

Dim conn As SqlCeConnection = Nothing
Dim cmd As SqlCeCommand = Nothing
Dim rdr As SqlCeDataReader = Nothing

Try
' Open the connection and create a SQL command
'
conn = New SqlCeConnection("Data Source = AdventureWorks.sdf")
conn.Open()

cmd = New SqlCeCommand("SELECT * FROM DimEmployee", conn)

rdr = cmd.ExecuteReader()

' Iterate through the results
'
While rdr.Read()
Dim employeeID As Integer = rdr.GetInt32(0) ' or:
rdr["EmployeeKey"];
Dim lastName As String = rdr.GetString(5) ' or: rdr["FirstName"];
End While

' Always dispose data readers and commands as soon as practicable
'
rdr.Close()
cmd.Dispose()
Finally
' Close the connection when no longer needed
'
conn.Close()
End Try


--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/...ramework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Beebs" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How can I get the contents of a field in SQL Mobile. I've just
> switched over from doing ADOCE projects so I'm quite clueless.
>
> For instance, I use to be able to do this:
>
> rs.Open(sqlString)
> If Not rs.EOF And Not rs.BOF Then
> If variable1 <> rs.Fields("Field1").Value.ToString() Then
> 'Do something
> Else
> 'Do something
> End If
> End If
> rs.Close()
>
> In SQL Mobile programming, I can't even figure out how to tell if
> there is a record in the query I set up in code. Can anyone give me
> some minor assistance with this?
>
> Thanks



 
Reply With Quote
 
Guest
Posts: n/a
 
      28th Jun 2006
http://msdn.microsoft.com/library/en...asp?frame=true

-Chris


"Beebs" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How can I get the contents of a field in SQL Mobile. I've just
> switched over from doing ADOCE projects so I'm quite clueless.
>
> For instance, I use to be able to do this:
>
> rs.Open(sqlString)
> If Not rs.EOF And Not rs.BOF Then
> If variable1 <> rs.Fields("Field1").Value.ToString() Then
> 'Do something
> Else
> 'Do something
> End If
> End If
> rs.Close()
>
> In SQL Mobile programming, I can't even figure out how to tell if
> there is a record in the query I set up in code. Can anyone give me
> some minor assistance with this?
>
> Thanks



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating Mobile Content Matthew Microsoft Frontpage 0 24th Jun 2009 01:15 AM
Update a field based upon the content of another field in other ta Wendy Microsoft Access Queries 1 29th May 2008 08:24 PM
Adding content of a field into a begining of a memo field =?Utf-8?B?TW9l?= Microsoft Access Form Coding 2 20th Apr 2007 10:32 PM
Customizing content to individual mobile users with replication =?Utf-8?B?dGhlS2lyaw==?= Microsoft Dot NET Compact Framework 1 14th Feb 2005 11:21 PM
Script in Outlook XP: replace content of the "subject" field with content from"new field" sachama Microsoft Outlook VBA Programming 0 26th Dec 2003 05:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:50 AM.