Tuesday, March 20, 2012

No .Fill method in Data Adapter

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 proble
m
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.
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();
}
Message posted via http://www.webservertalk.comDavid C via webservertalk.com wrote:
> 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.
>
You might be better off posting this to a csharp or adonet newgroup. It's
somewhat offtopic here, and you are less likely to get a response than you
would in a relevant dotnet group (all the .Net groups have the word "dotnet"
in their names).
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.|||I guess because it is about SQL Connectivity that it might apply here. I wil
l
post on DotNetForums.com to see if some may help me.
David
Bob Barrows [MVP] wrote:
>You might be better off posting this to a csharp or adonet newgroup. It's
>somewhat offtopic here, and you are less likely to get a response than you
>would in a relevant dotnet group (all the .Net groups have the word "dotnet
"
>in their names).
Message posted via http://www.webservertalk.com

No comments:

Post a Comment