Dataadgang SQL Server Mobile Edition
HalløjJeg har med stor succes brugt den her til sql server.
public DataTable GetDataTable(string sql)
{
DataSet ds = new DataSet();
DataTable dt = new DataTable();
OdbcDataAdapter da = new OdbcDataAdapter();
OdbcConnection con = new OdbcConnection("DSN=db;UID=sa;PWD=pass");
OdbcCommand cmd = new OdbcCommand(sql, con);
da.SelectCommand = cmd;
try
{
da.Fill(ds);
dt = ds.Tables[0];
return dt;
}
catch
{
return null;
}
}
Hvordan skal den se ud med SQL Server Mobile Edition?
Moget ala: sqlConn = new SqlCeConnection("Data Source = " + Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly( ).GetName( ).CodeBase), "db.sdf"));