Update Object must implement IConvertible?? 
Author Message
 Update Object must implement IConvertible??

When I run the following code, I receive the following error, "Update Object
must implement IConvertible"

// Set Parameter value from Textbox

SqlInt16 No{*filter*}s_value;

if(tbxHawaiiBookings_No{*filter*}s.Text == String.Empty)

{

    No{*filter*}s_value = SqlInt16.Null;

Quote:
}

else

{

    No{*filter*}s_value = SqlInt16.Parse(tbxHawaiiBookings_No{*filter*}s.Text);

Quote:
}

Update(No{*filter*}s_value,strConnectionString);

// Update Database with value

public void Update(SqlInt16 intNo{*filter*}s, string strConnectionString) {

SqlConnection objConnection;

SqlCommand objCommand;

try {

// Create and open the database connection

objConnection = new SqlConnection(strConnectionString);

objConnection.Open();

// Create and execute the command

objCommand = new SqlCommand();

objCommand.Connection = objConnection;

objCommand.CommandText = "procHawaiiBookingsUpdate";

objCommand.CommandType = CommandType.StoredProcedure;

//Create the parameters and append them to the command object


2, ParameterDirection.Input, false, 5, 0, "No{*filter*}s",
DataRowVersion.Proposed, intNo{*filter*}s));



Sat, 18 Sep 2004 02:52:39 GMT  
 Update Object must implement IConvertible??
 Shouldn't there be a "}" after
Update(No{*filter*}s_value,strConnectionString);?

Thank you,
Bobby Mattappally
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.



Sun, 19 Sep 2004 04:03:44 GMT  
 Update Object must implement IConvertible??
Thanks, Bobby, I think this was a case of butterfingers!

Regards,

David

BTW, do you know how to set a SqlBinary parameter to true or false?



Quote:
> Shouldn't there be a "}" after
> Update(No{*filter*}s_value,strConnectionString);?

> Thank you,
> Bobby Mattappally
> Microsoft Developer Support

> This posting is provided "AS IS" with no warranties, and confers no
rights.



Sun, 19 Sep 2004 05:44:10 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. object must implement IConvertible

2. System.InvalidCastException: Object must implement IConvertible.

3. IConvertible Casting

4. Do I really need to use IConvertible?

5. Help w/ IConvertible

6. Implementing an COM object

7. COM interop and objects that don't implement IUnknown

8. Implementing object creation in C++

9. Implement some Object-Oriented features with C

10. How to implement change notification from my COM object (ATL 7.0)

11. COM Objects that implement TCP/IP services

12. COM objects that implement TCP/IP services

 

 
Powered by phpBB® Forum Software