//method to create contracts public bool
Insert_ContractRecords(string contractID, string empName, SqlDateTime startDate,
SqlDateTime endDate, float amount, string vendorbrn, string name, string
products, string rfpRef, string projectTitle, string alert) { SqlCommand
cmd_ContractList = new SqlCommand();
cmd_ContractList.CommandText =
"[VRM].[INSERT_ContractRecords]"; cmd_ContractList.CommandType =
CommandType.StoredProcedure; cmd_ContractList.Parameters.Clear();
SqlParameter
sqlParaContractID = new SqlParameter("@contractID", SqlDbType.VarChar,
10);//ContractID sqlParaContractID.Value =
contractID; cmd_ContractList.Parameters.Add(sqlParaContractID);
SqlParameter
sqlParaEmpName = new SqlParameter("@empName", SqlDbType.VarChar, 140);//Owner
Name aka Employee Name sqlParaEmpName.Value =
formatWildCard(empName); cmd_ContractList.Parameters.Add(sqlParaEmpName);
SqlParameter
sqlParaStartDate = new SqlParameter("@startDate", SqlDbType.DateTime);
//Contract Start DATE sqlParaStartDate.Value =
startDate; cmd_ContractList.Parameters.Add(sqlParaStartDate);
SqlParameter
sqlParaEndDate = new SqlParameter("@endDate", SqlDbType.DateTime); //Contract
End date sqlParaEndDate.Value =
endDate; cmd_ContractList.Parameters.Add(sqlParaEndDate);
SqlParameter
sqlParaAmount = new SqlParameter("@amount", SqlDbType.Float);
//amount sqlParaAmount.Value =
amount; cmd_ContractList.Parameters.Add(sqlParaAmount);
SqlParameter
sqlParaVendorBRN = new SqlParameter("@vendorbrn", SqlDbType.VarChar,
10);//Vendor BRN sqlParaVendorBRN.Value =
vendorbrn; cmd_ContractList.Parameters.Add(sqlParaVendorBRN);
SqlParameter
sqlParaVendorName = new SqlParameter("@name", SqlDbType.VarChar, 140);//Vendor
Name sqlParaVendorName.Value =
name; cmd_ContractList.Parameters.Add(sqlParaVendorName);
SqlParameter
sqlParaProducts = new SqlParameter("@products", SqlDbType.VarChar,
1000);//Products/Services provided by vendor sqlParaProducts.Value =
products; cmd_ContractList.Parameters.Add(sqlParaProducts);
SqlParameter
sqlParaRFPRef = new SqlParameter("@rfpRef", SqlDbType.VarChar,
50);//RFPRef sqlParaRFPRef.Value =
rfpRef; cmd_ContractList.Parameters.Add(sqlParaRFPRef);
SqlParameter
sqlParaProjectTitle = new SqlParameter("@projectTitle", SqlDbType.VarChar,
50);//Project Title sqlParaProjectTitle.Value =
projectTitle; cmd_ContractList.Parameters.Add(sqlParaProjectTitle);
SqlParameter
sqlParaAlert = new SqlParameter("@alert", SqlDbType.VarChar,
1);//Alert sqlParaAlert.Value =
alert; cmd_ContractList.Parameters.Add(sqlParaAlert);
return
executeNotQuery(cmd_ContractList);
}
|
Suthish NairPosted Feb 16, 2011, 5:35 AM
Why dont just understand your code to get resolved. You are not putting time to resolve the errors.
We can only lead you, rest you need to work on it.
Dont wait for readymade answers, work on it. This how you learn from mistakes.
This seems to be copy pasted code
Becky BloomwoodPosted Feb 16, 2011, 5:31 AM
thanks!
Suthish NairPosted Feb 16, 2011, 4:47 AM
Convert.ToDateTime(txtStartDate.Text).ToString("dd-MMM-yyyy")Or use Parameterized Query
Becky BloomwoodPosted Feb 16, 2011, 4:04 AM
Suthish NairPosted Feb 16, 2011, 2:55 AM
Becky BloomwoodPosted Feb 14, 2011, 6:24 PM
Compiler Error Message: CS1502: The best overloaded method match for 'com.vrm.database.vrm_database.Insert_ContractRecords(string, string, System.Data.SqlTypes.SqlDateTime, System.Data.SqlTypes.SqlDateTime, float, string, string, string, string, string, string, string)' has some invalid arguments
Source Error:
How do I convert the textbox to allowing entering of values that are of datetime and float? Thanks!
Suthish NairPosted Feb 14, 2011, 12:47 PM