PlausiblyDamp
Administrator
Code:
Me.SqlSelectCommand1.CommandText = "SELECT tblPRUMaster.PruID, tblPRUMaster.PruNumber, tblPRUMaster.PermitNo, " & _
"tblPRUProduction.RptDate, tblPRUProduction.NorthOrSouth, tblPRUProduction.OilProd, " & _
"tblPRUProduction.GasProd, tblPRUProduction.MonthlyAllowableOil, " & _
"tblPRUProduction.MonthlyAllowableGas FROM tblPRUMaster INNER JOIN tblPRUProduction ON " & _
"tblPRUMaster.PruID = tblPRUProduction.PruID WHERE PermitNo = @PermitNum"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
Me.SelectCommand.Parameters.Add("@PermitNum", SqlDbType.Int)
Me.SelectCommand.Parameters("@PermitNum").Value = Integer.Parse(TextBox1.Text)
Does the above code make a difference? Also which line is the exception being raised on? If you step through the code in the debugger does TextBox1.Text contain the correct value?