Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 3rd, 2003, 07:57 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default Connection to SQL 2000 from the Compact Framework

Hi there,

I am designing and developing a data layer for a Compact Framework application that connects to a SQL Server 2000 on our (wireless) network.
Things work pretty OK: I can connect and retrieve data etc.

However, I am trying to use the Microsoft Application Blocks for DataAccess. They compile fine against the Compact Framework, but as soon as I use a parameter, its type is changed to sql_variant, causing the following error:

"Implicit conversion from data type sql_variant to int is not allowed. Use the CONVERT function to run this query."

Any idea how this is possible? I define them correctly, AFAIK:

Code:
SqlParameter[] arParms = new SqlParameter[2]; 

arParms[0] = new SqlParameter("@ID", SqlDbType.Int); 
arParms[0].Direction = ParameterDirection.Input; 
arParms[0].Value = 33; 

arParms[1] = new SqlParameter("@Description", SqlDbType.VarChar); 
arParms[1].Direction = ParameterDirection.Input; 
arParms[1].Size = 50; 
arParms[1].Value = "Test";
Suggestions, ideas etc are more than welcome.......

Regards,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Any one known VB 2005 compact framework sjar Visual Basic 2005 Basics 0 July 2nd, 2007 01:34 PM
How use framework components in compact framework? r_bazghaleh C# 0 February 19th, 2006 05:05 AM
Compact Framework Error spawning ". ????? drb2k2 General .NET 0 March 9th, 2005 02:13 PM
.Net Compact Framework Forum? Rissa Forum and Wrox.com Feedback 0 March 17th, 2004 05:28 PM
Compact Framework on Pocket PC egem VS.NET 2002/2003 2 February 3rd, 2004 03:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.