public bool Insert_ItemRecords(string itemID, string itemName, string itemDesc) { SqlCommand cmd_ItemList = new SqlCommand(); cmd_ItemList.CommandText = "[VRM].[INSERT_ItemRecords]"; cmd_ItemList.CommandType = CommandType.StoredProcedure; cmd_ItemList.Parameters.Clear(); SqlParameter sqlParaItemID = new SqlParameter("@itemID", SqlDbType.VarChar, 10); sqlParaItemID.Value = itemID; cmd_ItemList.Parameters.Add(sqlParaItemID); SqlParameter sqlParaItemName = new SqlParameter("@itemName", SqlDbType.VarChar, 100); sqlParaItemName.Value = itemName; cmd_ItemList.Parameters.Add(sqlParaItemName); SqlParameter sqlParaItemDesc = new SqlParameter("@itemDesc", SqlDbType.VarChar, 1000); sqlParaItemDesc.Value = fileName; cmd_ItemList.Parameters.Add(sqlParaItemDesc); return executeNotQuery(cmd_ItemList); }
ALTER PROCEDURE [OS].[INSERT_ITEMRecords] @itemID varchar(10),@itemName varchar(100),@itemDesc varchar(1000) ASINSERT INTO OS.Items (itemID, itemName, itemDesc)VALUES (@itemID, @itemName, @itemDesc)