| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == "Delete") |
| { |
| string ActionType = "DELETE"; |
| string Username = Session["Username"].ToString(); |
| string ServiceTypeName = "Website"; |
| string ServiceName; |
| string Fields; |
| string DateInserted = DateTime.Now.TimeOfDay.ToString(); |
| //Setup parameters from RadGrid columns |
| GridDataItem dataformItem = (GridDataItem)e.Item; |
| DataBoundLiteralControl txtbxClientId = (DataBoundLiteralControl)dataformItem["Client"].Controls[0]; |
| string ClientId = txtbxClientId.Text; |
| DataBoundLiteralControl txtbxServerId = (DataBoundLiteralControl)dataformItem["Server"].Controls[0]; |
| string ServerId = txtbxServerId.Text; |
| TableCell txtbxWebsiteUrl = (TableCell)dataformItem["WebsiteUrl"]; |
| string WebsiteUrl = txtbxWebsiteUrl.Text; |
| TableCell txtbxLogFilePath = (TableCell)dataformItem["LogFilePath"]; |
| string LogFilePath = txtbxLogFilePath.Text; |
| TableCell txtbxBandWidthCost = (TableCell)dataformItem["BandWidthCost"]; |
| string BandWidthCost = txtbxBandWidthCost.Text; |
| DataBoundLiteralControl txtbxChargeTypeId = (DataBoundLiteralControl)dataformItem["Charge"].Controls[0]; |
| string ChargeTypeId = txtbxChargeTypeId.Text; |
| TableCell txtbxAmount = (TableCell)dataformItem["Amount"]; |
| string Amount = txtbxAmount.Text; |
| TableCell txtbxBandWidthLimit = (TableCell)dataformItem["BandWidthlimit"]; |
| string BandWidthLimit = txtbxBandWidthLimit.Text; |
| CheckBox chkbxSqlDataBase = (CheckBox)dataformItem["SqlDatabase"].Controls[0]; |
| if (chkbxSqlDataBase.Checked == true) |
| { |
| chkbxSqlDataBase.Text = "1"; |
| } |
| else |
| { |
| chkbxSqlDataBase.Text = "0"; |
| } |
| string SqlDataBase = chkbxSqlDataBase.Text; |
| TableCell txtbxSqlMbLimit = (TableCell)dataformItem["SqlMbLimit"]; |
| string SqlMbLimit = txtbxSqlMbLimit.Text; |
| TableCell txtbxMbCharge = (TableCell)dataformItem["MbCharge"]; |
| string MbCharge = txtbxMbCharge.Text; |
| //Setup concatanated Fields parameter. |
| Fields = string.Format("{0};{1};{2};{3};{4};{5};{6};{7};{8};{9};{10}", ClientId, ServerId, WebsiteUrl, LogFilePath, BandWidthCost, ChargeTypeId, Amount, BandWidthLimit, SqlDataBase, SqlMbLimit, MbCharge); |
| ServiceName = WebsiteUrl; |
| //Execute Audit SP and pass through parameters |
| //LINQ |
| cknetispservicesDataContext db = new cknetispservicesDataContext(); |
| var testDs = db.spAudit(ActionType, Username, ServiceTypeName, ServiceName, Fields, Convert.ToDateTime(DateInserted)); |
| } |
| } |
The SP is fine i'm positive.
I had a breakpoint and i can see that all the information is there and the string is concatenated correctly.
I even ran a SQL profiler and can see the fields string in the stored procedure but still nothing is written to the fields column, other coumns are being written to perfectly.