Hi guys, ive got a small problem here... My program runs on localhost but when i click add button some message on the browser appear
here is my code:
<script language="VB" runat="server">
Protected Sub add_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim DBConn As New SqlClient.SqlConnection("Data Source=ML0003135586;Integrated Security=SSPI;" & "Initial Catalog=TestSQL")
Dim DBCmd As New SqlClient.SqlCommand
Dim DBAdap As New SqlClient.SqlDataAdapter
Dim DS As New DataSet
DBConn.Open()
Try
DBCmd = New SqlClient.SqlCommand("INSERT INTO [GEE5](costcenter, title, code, duration, attendees, batches) VALUES (@CostCenter, @Course_Title, @Course_Code, @Course_Duration, @Target_Attendees, @Target_Batches)", DBConn)
DBCmd.Parameters.Add("@CostCenter", SqlDbType.NVarChar).Value = CCenter.Text
DBCmd.Parameters.Add("@Course_Title", SqlDbType.NChar).Value = txtTitle.Text
DBCmd.Parameters.Add("@Course_Code", SqlDbType.NVarChar).Value = txtCode.Text
DBCmd.Parameters.Add("@Course_Duration", SqlDbType.NVarChar).Value = txtDuration.Text
DBCmd.Parameters.Add("@Target_Attendees", SqlDbType.NVarChar).Value = txtAttendees.Text
DBCmd.Parameters.Add("@Target_Batches", SqlDbType.NVarChar).Value = txtBatches.Text
DBCmd.ExecuteNonQuery()
Response.Write("Your Record is Updated ")
DBAdap = New SqlClient.SqlDataAdapter("SELECT * FROM [GEE5]", DBConn)
Catch exp As Exception
Response.Write(exp)
End Try
DBCmd.Dispose()
DBAdap.Dispose()
DBConn.Close()
DBConn = Nothing
End Sub
Here is the error message
System.Data.SqlClient.SqlException: Invalid object name 'GEE5'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ASP.dataadd_aspx.add_Click(Object sender, EventArgs e) in C:\Documents and Settings\oca14625\Desktop\TRYING2\dataadd.aspx:line 20
Cost Center: 12950 12939
Course Title:
Course Code:
Course Duration:
Target Attendees:
Target Batches:
Plss help me im new here... thanks in advance