I have been trying for a while to get a Windows Mobile device to connect to an SQL Express Server and pull data out of the DB using SQLDataReader.
Ive posted the code ive used below, but i cant get it to work with any variation. The server works fine as far as i can see, im accessing the same DB from desktop apps from various machines with no problem.
Im using the ip of the server, theres no firewall or AV installed on it and its running SQL Express 2008.
Ive tried it on several mobile devices, they are all connected ok to the network and will connect to the internet, resolve DNS etc, but in the app ive created i always get an SQLClient.SQLException, SQLConnection.OnError(), SQLInternalConnection.OnEr
ror() and SQLClient.TDSParser.Connec
This is driving me nuts!! Im going round and round in circles with it.
public partial class Rollcall : Form
SqlDataReader oReader = null;
SqlConnection oConnection = new SqlConnection("server=192.168.0.200\\Check;uid=user;pwd=password;database=CID");
private void Rollcall_Load(object sender, EventArgs e)
string sSelectSQL = "SELECT ID, fname, sname, company, host, visitortype FROM Live";
SqlCommand oCommand = new SqlCommand(sSelectSQL, oConnection);
oReader = oCommand.ExecuteReader();
DataSet ds = new DataSet();
DataTable dt = new DataTable("Table1");
ds.Load(oReader, LoadOption.PreserveChanges, ds.Tables);
dataGrid1.DataSource = ds.Tables;
catch (Exception oE)