Build ADO.NET ResultSets for Merge Replication.

I

iKiLL

Hi all

I am developing in C#, CF2 and SQL Mobile.

Currently my app is using Merge Replication. This is all working well.

I have now decided to try and use Result sets in my application but I am not
sure on how to handle this.

I have gone through examples on how to build a result set, but my
application creates the Database the first time it syncs.

How do I build a result set for a database that does not exist yet?

Thanks,
ink
 
W

William \(Bill\) Vaughn

I'm confused. How would SQLCe (or any SQL Engine) build a resultset without
a source of data?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
G

Ginny Caughey [MVP]

ink,

You have to have the database before you can connect to it, but you can
write code that creates a SqlCeResultSet programmatically once you have that
connection. Is this what you want to do?
 
I

iKiLL

Hi Ginny

Yeah this is what i am wanting to do but i was hoping to create it in the
IDE as an XML file so that it is Strong typed.

ink
 
W

William \(Bill\) Vaughn

While you can use the IDE to create a database and populate the schema,
there is no scripting support for SQLCe (yet) that would build an SQL DDL
script. Once the database is built, the IDE can build ST TableAdapters to
manage the data--but you need a populated database first. I have examples of
doing all of this in the IDE and code in my EBook.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
G

Ginny Caughey [MVP]

There is a designer in VS 2005 that you can use to create strong typed
SqlCeResultSet classes. You follow the same steps that you use to create a
typed dataset, except you change the property on the xsd file from
MSDataSetGenerator to MSResultSetGenerator. Probably you found this already,
and probably you also found that it needs the SDF file already so it can
read the schema to generate the classes.

One approach would be to pull the table you want so now you have a SQLCE
table, but since you're going to have to update your typed resultset code
each time there might be changes in the schema of the table you download, it
might end up being simpler to use untyped resultsets instead. The downside
of doing this is that you don't get the Intellisense assistance and data
casting that the strong typed resultset provides. The performance is going
to be about the same either way since the typed resultsets are very
lightweight.
 
I

iKiLL

Again Ginny, thanks for the response.

It is as you said in the first paragraph. And that is exactly how this
question came about.

I will I am not to bothered about the intellisense. And if there is no real
performance implication then i may as well use an untyped Result set.

Thanks,
ink
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top