Note that there are some explanatory texts on larger screens.

plurals
  1. POusing sql statements to insert data from a textbox directly into a datatable
    primarykey
    data
    text
    <p><strong>New Updates Below</strong></p> <p><em>My insert statement isn't executing when I run insertSQL()</em> I'm not sure if I am passing the parameters correctly. In my research, I see that SQL command is widely used to pass parameters, but this is the way that I am supposed to do it.</p> <p><strong>This is my updated code: FORM frmProcessLayout</strong> --> </p> <pre><code> public void insertSQL( string processName, string processingLevel, string department, string formName) { string[] parameters = new string[4]; sSql = "INSERT INTO [ServiceStation].[dbo].[ProcessLayout] ([ProcessName], [ProcessingLevel], [Department], [FormName]) VALUES(@Parameter[0], @Parameter[1], @Parameter[2], @Parameter[3])"; parameters[0] = processName; parameters[1] = processingLevel; parameters[2] = department; parameters[3] = formName; ssDBAccess.DBAccess oDb = new ssDBAccess.DBAccess(); oDb.SetConnection(); oDb.ExecuteNonSelectSQL(sSql, parameters); } </code></pre> <p>And this is what I'm looking at as reference to what I should do, but it is in Visual Basic</p> <pre><code> Function addRow(ByVal fax As String, ByVal scan As String, ByVal backup As String) Dim parameters(2) As String Addrow = Nothing ssql = "INSERT INTO [ServiceStation].[dbo].[OnBaseSweepFaxPath] ([FaxLine],[FaxSweepPath] ,[FaxBackupPath])" ssql += "VALUES(@Parameter0, @Parameter1, @Parameter2)" parameters(0) = fax parameters(1) = scan parameters(2) = backup odb.ExecuteNonSelectSQL(ssql, parameters) End Function </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload