help:About direct access sqlserver under CF

Y

yy

I want to access SQLserver directly in CF, so I write code like this:
conSql2000 = new SqlConnection(
"UID=SQL;Password=hello;data source=desktop IP;persist security
info=True;database=DotNetCF");
SqlCommand sqlGetOvertimeRates = new SqlCommand(
"SELECT OvertimeRateID,Description " +
"FROM OvertimeRates " +
"ORDER BY Description ",
conSql2000);
//open the connection
conSql2000.Open();


But thing make me sad is: it tell me the "SqlServer is not exit or the
Access is rejected", But I try to run the
Application which under /Debug on my destop pc. I found it work fine. I can
connect to sqlserver and retrieve the data.
Is there any thing I need to change, I mean things about the settings of
sqlserver? The server and the emulator runs on the same pc.
I can't figer out why. Who knows, please help me. Thanks forward!
 
D

Darren Shaffer

you need to use System.Data.SqlClient from the Compact Framework to
access SQL Server directly from device/emulator.
 

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