db.AddInParameter(dbCommand, "@updateMode", DbType.String, entCommon.UpdateMode);
db.AddInParameter(dbCommand, "@requestNumber", DbType.String, entCommon.RequestNumber);
db.AddInParameter(dbCommand, "@description", DbType.String, entCommon.Description);
db.AddInParameter(dbCommand, "@RequestTypeID", DbType.String, entCommon.RequestTypeID);
db.AddInParameter(dbCommand, "@requestPriorityID", DbType.String, entCommon.RequestPriorityID);
db.AddInParameter(dbCommand, "@remarks", DbType.String, entCommon.Remarks);
db.AddInParameter(dbCommand, "@requestedBy", DbType.String, entCommon.RequestedBy);
db.AddInParameter(dbCommand, "@requestedDate", DbType.String, entCommon.RequestedDate);
db.AddInParameter(dbCommand, "@approvedBy", DbType.String, entCommon.ApprovedBy);
db.AddInParameter(dbCommand, "@approvedDate", DbType.String, entCommon.ApprovedDate);
dbCommand.CommandTimeout = 0;
DataSet dsData = null;
dsData = db.ExecuteDataSet(dbCommand);
Asked
Active
Viewed 251 times
0

Gilad Green
- 36,708
- 7
- 61
- 95
-
7It is unclear what you are asking – Gilad Green Jul 31 '17 at 05:29
-
2If all of your parameter is `NULL`, then don't insert into database simple – Pranav Patel Jul 31 '17 at 05:38
-
you need to insert NULL in database? – raichiks Jul 31 '17 at 05:40
-
I cannot insert a another data because the entCommon.UpdateMode is null, what can I do? – Al Andrei Cababay Jul 31 '17 at 05:47
-
Unclear with your ask. If you are looking to Insert null, take a look at https://stackoverflow.com/questions/2602949/how-do-i-parameterize-a-null-string-with-dbnull-value-clearly-and-quickly – Sujith Jul 31 '17 at 06:06
1 Answers
1
The question is not clear!
If you want to set null value for SQL parameter - use
... = DBNull.Value;

Алексей К.
- 95
- 1
- 11
-
How can I construct it in my UI here is my Code for UI; if (txtBox_RNumber.Text != "" && txtBox_Des.Text != "") { BusCommon busCommon = new BusCommon("connDBPSC"); EntCommon entCommon = new EntCommon(); DataTable dtInf = busCommon.InsertITRequests(entCommon); } – Al Andrei Cababay Jul 31 '17 at 05:56