whats the wrong with my code i check all name data all same in sql server
Error
System.Data.SqlClient.SqlException: 'Column name or number of supplied values does not match table definition.'
This exception was originally thrown at this call stack: [External Code] Project_service.rasmi.Button1_Click(Object, System.EventArgs) in rasmi.vb [External Code]
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
ReportViewer_rasmi.PrintDialog()
If Form1.RadioButton4.Checked Then
Form1.TotalrmTextBox.Text = Form1.RadioButton4.Text
Else
Form1.TotalrmTextBox.Text = "تقرير"
End If
If Form1.RadioButton3.Checked Then
Form1.TotalrmTextBox.Text = Form1.RadioButton3.Text
Else
Form1.TotalrmTextBox.Text = "تقرير"
End If
Dim namerm As String = Form1.NameTextBox.Text
Dim civilrm As String = Form1.CivilidTextBox.Text
Dim datetimetoday As String = Format(Form1.DateTimePicker4.Value, "yyyy/MM/dd")
Dim inform As String = "مهمة رسمية"
Dim totalrm As String = Form1.TotalrmTextBox.Text
Dim el3malrm As String = Form1.Markazel3malComboBox.Text
Dim datetimenow As String = Format(Form1.DateTimePicker1.Value, "hh:mm tt dddd ")
Dim CountryId As String = "Cancelled"
Dim locationz As String = Form1.NamelocationComboBox.Text
Dim machineName As String = Form1.Label40.Text & vbCr & Form1.Label41.Text
Dim others1 As String = Form1.Label29.Text
Dim query As String = "INSERT INTO Table_Rsmi values (@namerm,@civilrm,@daterm,@inform,@totalrm,@el3malrm,@datetime,@CountryId,@locationz,@machineName,@others1,@totaltimespplus)"
Using con As New SqlConnection("Data Source=GSD;Initial Catalog=kankon;Persist Security Info=True;User ID=gsd;Password=1234500;MultipleActiveResultSets=True")
Using cmd As New SqlCommand(query, con)
cmd.Parameters.AddWithValue("@namerm", namerm)
cmd.Parameters.AddWithValue("@civilrm", civilrm)
cmd.Parameters.AddWithValue("@daterm", datetimetoday)
cmd.Parameters.AddWithValue("@datetime", datetimenow)
cmd.Parameters.AddWithValue("@totalrm", totalrm)
cmd.Parameters.AddWithValue("@CountryId", CountryId)
cmd.Parameters.AddWithValue("@el3malrm", el3malrm)
cmd.Parameters.AddWithValue("@locationz", locationz)
cmd.Parameters.AddWithValue("@others1", others1)
cmd.Parameters.AddWithValue("@totaltimespplus", Convert.ToDateTime(DateTime.Now.ToLongTimeString()))
cmd.Parameters.AddWithValue("@inform", inform)
cmd.Parameters.AddWithValue("@machineName", machineName)
Dim zerah1 As New ReportParameter("zerah", False)
ReportViewer_rasmi.LocalReport.SetParameters(zerah1)
Dim hidereport As New ReportParameter("hidereport", False)
ReportViewer_rasmi.LocalReport.SetParameters(hidereport)
Dim cleaner As New ReportParameter("cleaner", False)
ReportViewer_rasmi.LocalReport.SetParameters(cleaner)
Dim ReportENG1 As New ReportParameter("ReportENG1", False)
ReportViewer_rasmi.LocalReport.SetParameters(ReportENG1)
Dim ReportENG2 As New ReportParameter("ReportENG2", False)
ReportViewer_rasmi.LocalReport.SetParameters(ReportENG2)
Dim Reporthidrasmi As New ReportParameter("Reporthidrasmi", True)
ReportViewer_rasmi.LocalReport.SetParameters(Reporthidrasmi)
Dim hidzyarah As New ReportParameter("hidzyarah", False)
ReportViewer_rasmi.LocalReport.SetParameters(hidzyarah)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Form1.CheckBox11.Checked = False
Form1.CheckBox6.Checked = False
Form1.CheckBox3.Checked = False
Form1.CheckBox5.Checked = False
Form1.CheckBox4.Checked = False
Form1.CheckBox12.Checked = False
Form1.RadioButton3.Checked = False
Form1.RadioButton4.Checked = False
Form1.Rasme.Enabled = False
ReportViewer_rasmi.RefreshReport()
End Using
End Using
End Sub