Advertisement

05.19.2008 at 01:07AM PDT, ID: 23412977
[x]
Attachment Details

how to insert null value in a table using SQLParameter class

Asked by deepakyadav in Microsoft Visual C#.Net

Tags: C# dot net 2.0

i am working on a windows application made in C# dotnet 2005.
in this i have a form which have a  list which gets filled from another table.
basically i have a column in a table which is forgein key.

now i wrote a update query and i want to insert null if user does not select any item from the list.
and this column is of int type in the database.

and i am using SQLParameter class to add values in update query.

here is a sample code of how i am using SQLParameter class

                SqlParameter SqlParam_GeneralLedgerAccountOID = new SqlParameter();
                SqlParam_GeneralLedgerAccountOID.ParameterName = "@OID";
                SqlParam_GeneralLedgerAccountOID.Value = OID;
                command.Parameters.Add(SqlParam_GeneralLedgerAccountOID);

how can insert null value using  SQLparameter classStart Free Trial
 
Loading Advertisement...
 
[+][-]05.19.2008 at 01:39AM PDT, ID: 21596040

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual C#.Net
Tags: C# dot net 2.0
Sign Up Now!
Solution Provided By: TimCottee
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628