473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

The connection is already Open (state=Open).

ST
This is my other error when I click on Immunoflourescence. I believe this is
related to the other error I just posted (Input string was not in a correct
format.) Please let me know if you have any suggestions! Thanks!

The connection is already Open (state=Open).
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The connection is
already Open (state=Open).

Source Error:
Line 132: End If
Line 133:
Line 134: connStr.Open()
Line 135: Try
Line 136: c.ExecuteNonQuery()
*******MY CODE********
Imports System.Data.SqlClient

Public Class proteindiagnosis1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents txtDate As System.Web.UI.WebControls.TextBox
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents ddlPM As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Protected WithEvents ddlBlot_DR As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents Label6 As System.Web.UI.WebControls.Label
Protected WithEvents ddlBlot_DD As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label7 As System.Web.UI.WebControls.Label
Protected WithEvents txtBlot_DSize As System.Web.UI.WebControls.TextBox
Protected WithEvents Label8 As System.Web.UI.WebControls.Label
Protected WithEvents txtBlot_DQ As System.Web.UI.WebControls.TextBox
Protected WithEvents Label9 As System.Web.UI.WebControls.Label
Protected WithEvents txtBlot_DStain As System.Web.UI.WebControls.TextBox
Protected WithEvents Label10 As System.Web.UI.WebControls.Label
Protected WithEvents ddlBlot_DF As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label12 As System.Web.UI.WebControls.Label
Protected WithEvents Label11 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DR As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label13 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DD As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label14 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DRV As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label15 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DA1 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label16 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DA2 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label17 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_MR As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label18 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_MA1 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label19 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_MA2 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label20 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_AR As System.Web.UI.WebControls.DropDownList
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Protected WithEvents tblImmunoblot As System.Web.UI.WebControls.Table
Protected WithEvents tblImmunoflo As System.Web.UI.WebControls.Table
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents txtError As System.Web.UI.WebControls.Label
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents RegularExpressionValidator2 As
System.Web.UI.WebControls.RegularExpressionValidat or
Protected WithEvents Label21 As System.Web.UI.WebControls.Label
Protected WithEvents txtNotes As System.Web.UI.WebControls.TextBox
Protected WithEvents Label22 As System.Web.UI.WebControls.Label
Protected WithEvents btnBack As System.Web.UI.WebControls.Button
Protected WithEvents btnMain As System.Web.UI.WebControls.Button
Protected WithEvents btnLogOff As System.Web.UI.WebControls.Button

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

End Sub

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
Dim connStr As New SqlConnection(Application("cn"))
Dim c As New SqlCommand
'Either UPDATE or INSERT the information
If Session("update") = "True" Then
c.CommandText = "UPDATE PROTEIN_DIAGNOSIS SET DIAG_DATE=@date,
DYST_RESULT=@DYST_RESULT, DYST_DIAGNOSIS=@DYST_DIAGNOSIS,
DYST_SIZE=@DYST_SIZE, DYST_QUANTITY=@DYST_QUANTITY,
DYST_STAINING=@DYST_STAINING, DYST_ANTIBODY_1=@DYST_ANTIBODY_1,
DYST_ANTIBODY_2=@DYST_ANTIBODY_2, DYST_REVERTANTS=@DYST_REVERTANTS,
MEROSIN_RESULT=@MEROSIN_RESULT, MEROSIN_ANTIBODY_1=@MEROSIN_ANTIBODY_1,
MEROSIN_ANTIBODY_2=@MEROSIN_ANTIBODY_2, ALPHA_SAC_RESULT=@ALPHA_SAC_RESULT,
DYSFERLIN_RESULT=@DYSFERLIN_RESULT, NOTES=@NOTES where procedure_Id = '" &
Session("Procedure_ID") & "' AND protein_diag_method = '" &
ddlPM.SelectedValue & "'"
Session("update") = "False"
Else
c.CommandText = "INSERT INTO PROTEIN_DIAGNOSIS (PROCEDURE_ID,
PROTEIN_DIAG_METHOD, DIAG_DATE, DYST_RESULT,"
c.CommandText &= " DYST_DIAGNOSIS, DYST_SIZE, DYST_QUANTITY,
DYST_STAINING, DYSFERLIN_RESULT,"
c.CommandText &= " DYST_REVERTANTS, DYST_ANTIBODY_1,
DYST_ANTIBODY_2, MEROSIN_RESULT, MEROSIN_ANTIBODY_1, MEROSIN_ANTIBODY_2,
ALPHA_SAC_RESULT, NOTES)"
c.CommandText &= " VALUES (@Proc, @Method, @Date, @DYST_RESULT,
@DYST_DIAGNOSIS, @DYST_SIZE, @DYST_QUANTITY, @DYST_STAINING,
@DYSFERLIN_RESULT,"
c.CommandText &= " @DYST_REVERTANTS, @DYST_ANTIBODY_1,
@DYST_ANTIBODY_2, @MEROSIN_RESULT, @MEROSIN_ANTIBODY_1, @MEROSIN_ANTIBODY_2,
@ALPHA_SAC_RESULT, @NOTES)"
End If
c.Connection = connStr
c.CommandType = CommandType.Text

'Biopsy Pathology Information
c.Parameters.Add("@Proc", SqlDbType.Int).Value =
Session("Procedure_ID")
c.Parameters.Add("@Method", SqlDbType.Char, 20).Value =
ddlPM.SelectedValue
c.Parameters.Add("@Date", SqlDbType.DateTime).Value = txtDate.Text
c.Parameters.Add("@Notes", SqlDbType.VarChar, 255).Value =
txtNotes.Text
If ddlPM.SelectedValue = "IMMUNOBLOT" Then
c.Parameters.Add("@DYST_RESULT", SqlDbType.VarChar, 20).Value =
ddlBlot_DR.SelectedValue
c.Parameters.Add("@DYST_DIAGNOSIS", SqlDbType.VarChar, 20).Value
= ddlBlot_DD.SelectedValue
c.Parameters.Add("@DYST_SIZE", SqlDbType.Int).Value =
txtBlot_DSize.Text
c.Parameters.Add("@DYST_QUANTITY", SqlDbType.Int).Value =
txtBlot_DQ.Text
c.Parameters.Add("@DYST_STAINING", SqlDbType.Int).Value =
txtBlot_DStain.Text
c.Parameters.Add("@DYSFERLIN_RESULT", SqlDbType.VarChar,
20).Value = ddlBlot_DF.SelectedValue
c.Parameters.Add("@DYST_REVERTANTS", SqlDbType.VarChar, 3).Value
= "1"
c.Parameters.Add("@DYST_ANTIBODY_1", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@DYST_ANTIBODY_2", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@MEROSIN_RESULT", SqlDbType.VarChar, 20).Value
= "1"
c.Parameters.Add("@MEROSIN_ANTIBODY_1", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@MEROSIN_ANTIBODY_2", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@ALPHA_SAC_RESULT", SqlDbType.VarChar,
20).Value = "1"
End If
If ddlPM.SelectedValue = "IMMUNOFLO" Then
c.Parameters.Add("@DYST_RESULT", SqlDbType.VarChar, 20).Value =
ddlFlu_DR.SelectedValue
c.Parameters.Add("@DYST_DIAGNOSIS", SqlDbType.VarChar, 20).Value
= ddlFlu_DD.SelectedValue
c.Parameters.Add("@DYST_SIZE", SqlDbType.Int).Value = DBNull.Value
c.Parameters.Add("@DYST_QUANTITY", SqlDbType.Int).Value =
DBNull.Value
c.Parameters.Add("@DYST_STAINING", SqlDbType.Int).Value =
DBNull.Value
c.Parameters.Add("@DYSFERLIN_RESULT", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@DYST_REVERTANTS", SqlDbType.VarChar, 3).Value
= ddlFlu_DRV.SelectedValue
c.Parameters.Add("@DYST_ANTIBODY_1", SqlDbType.VarChar,
20).Value = ddlFlu_DA1.SelectedValue
c.Parameters.Add("@DYST_ANTIBODY_2", SqlDbType.VarChar,
20).Value = ddlFlu_DA2.SelectedValue
c.Parameters.Add("@MEROSIN_RESULT", SqlDbType.VarChar, 20).Value
= ddlFlu_MR.SelectedValue
c.Parameters.Add("@MEROSIN_ANTIBODY_1", SqlDbType.VarChar,
20).Value = ddlFlu_MA1.SelectedValue
c.Parameters.Add("@MEROSIN_ANTIBODY_2", SqlDbType.VarChar,
20).Value = ddlFlu_MA2.SelectedValue
c.Parameters.Add("@ALPHA_SAC_RESULT", SqlDbType.VarChar,
20).Value = ddlFlu_AR.SelectedValue
End If

connStr.Open()
Try
c.ExecuteNonQuery()
Catch myerr As SqlException
txtError.Visible = True
txtError.Text = myerr.Message
Finally
connStr.Close()
End Try
'txtError.Visible = True
'txtError.Text = Session("Procedure_ID")

End Sub 'Page_Load


Jul 21 '05 #1
1 6445
How about checking the conncetion before opening it..
Try the follwing code :-

SqlConnection cn = new SqlConnection

if(cn.State !=ConnectionState.Open) cn.Open()

This should have been done anyway...And this is a good practice to check the
connection state always.

"ST" wrote:
This is my other error when I click on Immunoflourescence. I believe this is
related to the other error I just posted (Input string was not in a correct
format.) Please let me know if you have any suggestions! Thanks!

The connection is already Open (state=Open).
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The connection is
already Open (state=Open).

Source Error:
Line 132: End If
Line 133:
Line 134: connStr.Open()
Line 135: Try
Line 136: c.ExecuteNonQuery()
*******MY CODE********
Imports System.Data.SqlClient

Public Class proteindiagnosis1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents txtDate As System.Web.UI.WebControls.TextBox
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents ddlPM As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Protected WithEvents ddlBlot_DR As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents Label6 As System.Web.UI.WebControls.Label
Protected WithEvents ddlBlot_DD As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label7 As System.Web.UI.WebControls.Label
Protected WithEvents txtBlot_DSize As System.Web.UI.WebControls.TextBox
Protected WithEvents Label8 As System.Web.UI.WebControls.Label
Protected WithEvents txtBlot_DQ As System.Web.UI.WebControls.TextBox
Protected WithEvents Label9 As System.Web.UI.WebControls.Label
Protected WithEvents txtBlot_DStain As System.Web.UI.WebControls.TextBox
Protected WithEvents Label10 As System.Web.UI.WebControls.Label
Protected WithEvents ddlBlot_DF As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label12 As System.Web.UI.WebControls.Label
Protected WithEvents Label11 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DR As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label13 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DD As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label14 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DRV As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label15 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DA1 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label16 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_DA2 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label17 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_MR As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label18 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_MA1 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label19 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_MA2 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label20 As System.Web.UI.WebControls.Label
Protected WithEvents ddlFlu_AR As System.Web.UI.WebControls.DropDownList
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Protected WithEvents tblImmunoblot As System.Web.UI.WebControls.Table
Protected WithEvents tblImmunoflo As System.Web.UI.WebControls.Table
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents txtError As System.Web.UI.WebControls.Label
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents RegularExpressionValidator2 As
System.Web.UI.WebControls.RegularExpressionValidat or
Protected WithEvents Label21 As System.Web.UI.WebControls.Label
Protected WithEvents txtNotes As System.Web.UI.WebControls.TextBox
Protected WithEvents Label22 As System.Web.UI.WebControls.Label
Protected WithEvents btnBack As System.Web.UI.WebControls.Button
Protected WithEvents btnMain As System.Web.UI.WebControls.Button
Protected WithEvents btnLogOff As System.Web.UI.WebControls.Button

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

End Sub

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
Dim connStr As New SqlConnection(Application("cn"))
Dim c As New SqlCommand
'Either UPDATE or INSERT the information
If Session("update") = "True" Then
c.CommandText = "UPDATE PROTEIN_DIAGNOSIS SET DIAG_DATE=@date,
DYST_RESULT=@DYST_RESULT, DYST_DIAGNOSIS=@DYST_DIAGNOSIS,
DYST_SIZE=@DYST_SIZE, DYST_QUANTITY=@DYST_QUANTITY,
DYST_STAINING=@DYST_STAINING, DYST_ANTIBODY_1=@DYST_ANTIBODY_1,
DYST_ANTIBODY_2=@DYST_ANTIBODY_2, DYST_REVERTANTS=@DYST_REVERTANTS,
MEROSIN_RESULT=@MEROSIN_RESULT, MEROSIN_ANTIBODY_1=@MEROSIN_ANTIBODY_1,
MEROSIN_ANTIBODY_2=@MEROSIN_ANTIBODY_2, ALPHA_SAC_RESULT=@ALPHA_SAC_RESULT,
DYSFERLIN_RESULT=@DYSFERLIN_RESULT, NOTES=@NOTES where procedure_Id = '" &
Session("Procedure_ID") & "' AND protein_diag_method = '" &
ddlPM.SelectedValue & "'"
Session("update") = "False"
Else
c.CommandText = "INSERT INTO PROTEIN_DIAGNOSIS (PROCEDURE_ID,
PROTEIN_DIAG_METHOD, DIAG_DATE, DYST_RESULT,"
c.CommandText &= " DYST_DIAGNOSIS, DYST_SIZE, DYST_QUANTITY,
DYST_STAINING, DYSFERLIN_RESULT,"
c.CommandText &= " DYST_REVERTANTS, DYST_ANTIBODY_1,
DYST_ANTIBODY_2, MEROSIN_RESULT, MEROSIN_ANTIBODY_1, MEROSIN_ANTIBODY_2,
ALPHA_SAC_RESULT, NOTES)"
c.CommandText &= " VALUES (@Proc, @Method, @Date, @DYST_RESULT,
@DYST_DIAGNOSIS, @DYST_SIZE, @DYST_QUANTITY, @DYST_STAINING,
@DYSFERLIN_RESULT,"
c.CommandText &= " @DYST_REVERTANTS, @DYST_ANTIBODY_1,
@DYST_ANTIBODY_2, @MEROSIN_RESULT, @MEROSIN_ANTIBODY_1, @MEROSIN_ANTIBODY_2,
@ALPHA_SAC_RESULT, @NOTES)"
End If
c.Connection = connStr
c.CommandType = CommandType.Text

'Biopsy Pathology Information
c.Parameters.Add("@Proc", SqlDbType.Int).Value =
Session("Procedure_ID")
c.Parameters.Add("@Method", SqlDbType.Char, 20).Value =
ddlPM.SelectedValue
c.Parameters.Add("@Date", SqlDbType.DateTime).Value = txtDate.Text
c.Parameters.Add("@Notes", SqlDbType.VarChar, 255).Value =
txtNotes.Text
If ddlPM.SelectedValue = "IMMUNOBLOT" Then
c.Parameters.Add("@DYST_RESULT", SqlDbType.VarChar, 20).Value =
ddlBlot_DR.SelectedValue
c.Parameters.Add("@DYST_DIAGNOSIS", SqlDbType.VarChar, 20).Value
= ddlBlot_DD.SelectedValue
c.Parameters.Add("@DYST_SIZE", SqlDbType.Int).Value =
txtBlot_DSize.Text
c.Parameters.Add("@DYST_QUANTITY", SqlDbType.Int).Value =
txtBlot_DQ.Text
c.Parameters.Add("@DYST_STAINING", SqlDbType.Int).Value =
txtBlot_DStain.Text
c.Parameters.Add("@DYSFERLIN_RESULT", SqlDbType.VarChar,
20).Value = ddlBlot_DF.SelectedValue
c.Parameters.Add("@DYST_REVERTANTS", SqlDbType.VarChar, 3).Value
= "1"
c.Parameters.Add("@DYST_ANTIBODY_1", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@DYST_ANTIBODY_2", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@MEROSIN_RESULT", SqlDbType.VarChar, 20).Value
= "1"
c.Parameters.Add("@MEROSIN_ANTIBODY_1", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@MEROSIN_ANTIBODY_2", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@ALPHA_SAC_RESULT", SqlDbType.VarChar,
20).Value = "1"
End If
If ddlPM.SelectedValue = "IMMUNOFLO" Then
c.Parameters.Add("@DYST_RESULT", SqlDbType.VarChar, 20).Value =
ddlFlu_DR.SelectedValue
c.Parameters.Add("@DYST_DIAGNOSIS", SqlDbType.VarChar, 20).Value
= ddlFlu_DD.SelectedValue
c.Parameters.Add("@DYST_SIZE", SqlDbType.Int).Value = DBNull.Value
c.Parameters.Add("@DYST_QUANTITY", SqlDbType.Int).Value =
DBNull.Value
c.Parameters.Add("@DYST_STAINING", SqlDbType.Int).Value =
DBNull.Value
c.Parameters.Add("@DYSFERLIN_RESULT", SqlDbType.VarChar,
20).Value = "1"
c.Parameters.Add("@DYST_REVERTANTS", SqlDbType.VarChar, 3).Value
= ddlFlu_DRV.SelectedValue
c.Parameters.Add("@DYST_ANTIBODY_1", SqlDbType.VarChar,
20).Value = ddlFlu_DA1.SelectedValue
c.Parameters.Add("@DYST_ANTIBODY_2", SqlDbType.VarChar,
20).Value = ddlFlu_DA2.SelectedValue
c.Parameters.Add("@MEROSIN_RESULT", SqlDbType.VarChar, 20).Value
= ddlFlu_MR.SelectedValue
c.Parameters.Add("@MEROSIN_ANTIBODY_1", SqlDbType.VarChar,
20).Value = ddlFlu_MA1.SelectedValue
c.Parameters.Add("@MEROSIN_ANTIBODY_2", SqlDbType.VarChar,
20).Value = ddlFlu_MA2.SelectedValue
c.Parameters.Add("@ALPHA_SAC_RESULT", SqlDbType.VarChar,
20).Value = ddlFlu_AR.SelectedValue
End If

connStr.Open()
Try
c.ExecuteNonQuery()
Catch myerr As SqlException
txtError.Visible = True
txtError.Text = myerr.Message
Finally
connStr.Close()
End Try
'txtError.Visible = True
'txtError.Text = Session("Procedure_ID")

End Sub 'Page_Load


Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ST | last post by:
This is my other error when I click on Immunoflourescence. I believe this is related to the other error I just posted (Input string was not in a correct format.) Please let me know if you have...
5
by: Sam | last post by:
Hi all, I have a process which first pulls one time all application IDs from a database and stores them in a table(this process works fine everytime). I then loop through the table, one at a...
14
by: martin1 | last post by:
All, I want to check wether db connection/open or not, if not it will post db connection error to user in message box The code is like: Dim objConnection As New SqlConnection _...
8
by: Imran Aziz | last post by:
Hello All, Like in C++ I tried to use constructor to open a database connection and distructor to close the database connection, it now turns out that one cannot create distrutors in C# classes. ...
1
by: tshad | last post by:
I have a situation where I could Try Open a Connection ExecuteReader Close Reader Catch may not happen - Possible if this a Timer in a Windows Service
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
9
by: fniles | last post by:
I am using VB.NET 2003 and SQL 2005. To use connection pooling and avoid the error "There is already an open DataReader associated with this Connection which must be closed first." , I understand...
2
by: pmclinn | last post by:
When I'm connecting to Oracle or SQL I always wonder what is the best way to close/dispose of a connection. I've been toying around with creating a public shared class that has a connection string...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.