Jeff Mangan [mailto:[EMAIL PROTECTED]] wrote:
> I have a datareader and for each row, I am passing two of the > column values to a c# function in my code behind. They are a > bit and varchar(50). My c# function will only work if I make > the parameters as objects ie. MyFunc (object value1, object > value2). I don't want to do it this way due to many reasons, > overhead for one. What are the proper datatypes for a > varchar(50) and a bit from sql server? do I need to cast > them down to another value or what?? This bit could also be > null, and the varchar(50) is a guid. The types coming back are System.Data.SqlTypes types. These types are required to map to/from native .NET types as well as to handle things like null. You can make the parameters of your functions these SqlBinary and SqlString or make them System.Boolean and System.String and convert to these types before calling your function (remember to watch for null!). HTH, Drew You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.