G
Guest
I am developing a Smart Device project for my Symbol MC9000 Windows Mobile
handheld. I am trying to make a simple connection to a SQL server. My problem
is my Data Adapter object does not have a .FILL method as it always has in
normal C# desktop apps.
I also noticed I cannot do a dataadapter object.dispose() either (i.e da.
Dispose() ). Am I missing something or is this development environment for
mobile just that limited?
The intellisense only shows the following methods/properties for the da
object.
..DeleteCommand, .InsertCommand, .RowUpdated, .RowUpdating, .SelectCommand,
and .UpdateCommand.
That all it lists. Do I need to install something maybe?
I have never done a mobile app so this is all new to me.
Any help would be greatly appreciated.
Below is some of the code I am developing just to make the connection.
Thanks,
David
// Connection String for MSSQL Server
string Connection_String = "Initial Catalog=WINSTSDB;Data
Source=DB2ML350;workstation id=Symbol_MC9000w;packet size=4096;integrated
security=SSPI";
// Setup SQL Connection object
SqlConnection dbConn = new SqlConnection( Connection_String );
// Create Data Adapter object with SQL statement.
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM RackTemp WHERE SID =
'" + strSidcode + "'",dbConn);
// Define a Data Table object
System.Data.DataTable WinstisTable = new DataTable();
try
{
// Pull in data into data table object named WinstisTable
conn.Open();
da.Fill( WinstisTable );
}
catch(Exception exc)
{
MessageBox.Show(exc.Message.ToString(),"Error",MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}
finally
{
// Close connection
conn.Close();
}
handheld. I am trying to make a simple connection to a SQL server. My problem
is my Data Adapter object does not have a .FILL method as it always has in
normal C# desktop apps.
I also noticed I cannot do a dataadapter object.dispose() either (i.e da.
Dispose() ). Am I missing something or is this development environment for
mobile just that limited?
The intellisense only shows the following methods/properties for the da
object.
..DeleteCommand, .InsertCommand, .RowUpdated, .RowUpdating, .SelectCommand,
and .UpdateCommand.
That all it lists. Do I need to install something maybe?
I have never done a mobile app so this is all new to me.
Any help would be greatly appreciated.
Below is some of the code I am developing just to make the connection.
Thanks,
David
// Connection String for MSSQL Server
string Connection_String = "Initial Catalog=WINSTSDB;Data
Source=DB2ML350;workstation id=Symbol_MC9000w;packet size=4096;integrated
security=SSPI";
// Setup SQL Connection object
SqlConnection dbConn = new SqlConnection( Connection_String );
// Create Data Adapter object with SQL statement.
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM RackTemp WHERE SID =
'" + strSidcode + "'",dbConn);
// Define a Data Table object
System.Data.DataTable WinstisTable = new DataTable();
try
{
// Pull in data into data table object named WinstisTable
conn.Open();
da.Fill( WinstisTable );
}
catch(Exception exc)
{
MessageBox.Show(exc.Message.ToString(),"Error",MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}
finally
{
// Close connection
conn.Close();
}