hey i m using the codeand i m hving exception on Response.Redirecte statementCode:Protected Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click Dim selstr, insstr As String Dim i As Integer Dim obj As New DataClass Dim sqlConn As SqlConnection Dim sqlComm, insComm As SqlCommand Dim dr As SqlDataReader 'i = Max("IssueNumber", "Master_Table") + 1 Try selstr = "Select max(IssueNumber) From Master_Table" sqlConn = obj.makeConnection() sqlComm = New SqlCommand(selstr, sqlConn) dr = sqlComm.ExecuteReader dr.Read() i = CInt(dr(0).ToString) + 1 insstr = "Insert into Master_Table([IssueNumber],[Flag]) Values(" & i & " ,'Open')" dr.Close() insComm = New SqlCommand(insstr, sqlConn) insComm.ExecuteNonQuery() ds = Nothing Response.Redirect("EntryNewRec.aspx?IssueNumber=" & i) Catch ex As Exception End Try 'obj.closeDatabase() End Sub
it says
The ConnectionString property has not been initialized.
[InvalidOperationException: The ConnectionString property has not been initialized.]i donno know just before a while it was running good. but now its not running i hvnt even touched that...Code:System.Data.SqlClient.SqlConnection.PermissionDemand() +856947 System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection) +22 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +92 System.Web.UI.WebControls.ListControl.PerformSelect() +31 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26 System.Web.UI.Control.PreRenderRecursiveInternal() +77 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint
Please help...
Thanks


Reply With Quote
