Hi,
I keep getting this error when I move my site over to the production server from my local machine server, and I can't figure out why. It's a simple page, with little complicated code. And it works perfectly fine from my machine...which leads me to believe it has something to do with IIS, Windows Authorization, or some setting in SQL. Does anyone have any ideas??? I feel like I've tried all sorts of combinations of things, but I can't figure it out. Thanks!
This is my vb.net code:
Imports System.Data.SqlClient
Public Class Neuroreg
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.Debugg
erStepThro
ugh()> 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 Label3 As System.Web.UI.WebControls.
Label
Protected WithEvents Label4 As System.Web.UI.WebControls.
Label
Protected WithEvents Label5 As System.Web.UI.WebControls.
Label
Protected WithEvents Label6 As System.Web.UI.WebControls.
Label
Protected WithEvents Label7 As System.Web.UI.WebControls.
Label
Protected WithEvents Label8 As System.Web.UI.WebControls.
Label
Protected WithEvents Label9 As System.Web.UI.WebControls.
Label
Protected WithEvents Label10 As System.Web.UI.WebControls.
Label
Protected WithEvents Label11 As System.Web.UI.WebControls.
Label
Protected WithEvents Label12 As System.Web.UI.WebControls.
Label
Protected WithEvents Label13 As System.Web.UI.WebControls.
Label
Protected WithEvents Label14 As System.Web.UI.WebControls.
Label
Protected WithEvents Label15 As System.Web.UI.WebControls.
Label
Protected WithEvents Label16 As System.Web.UI.WebControls.
Label
Protected WithEvents Label17 As System.Web.UI.WebControls.
Label
Protected WithEvents Label18 As System.Web.UI.WebControls.
Label
Protected WithEvents Label19 As System.Web.UI.WebControls.
Label
Protected WithEvents Button1 As System.Web.UI.WebControls.
Button
Protected WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlD
ataAdapter
Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlC
ommand
Protected WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlC
ommand
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlC
onnection
Protected WithEvents txtfname As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtlname As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtadd1 As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtadd2 As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtcity As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtstate As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtzip As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtemail As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtpatient As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtparent As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtfam As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtphys As System.Web.UI.WebControls.
TextBox
Protected WithEvents txtother As System.Web.UI.WebControls.
TextBox
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara
tion 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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strConn As System.Data.SqlClient.SqlC
onnection
Dim c As New SqlCommand
strConn = New System.Data.SqlClient.SqlC
onnection(
"Persist Security Info=True;Data Source=CRI; Initial Catalog=CRIWEBData;UID=***
**;passwor
d=*****;po
oling=True
;max pool size=100;")
c.CommandText = "INSERT INTO NEURO_EVENT (FNAME, LNAME, ADDRESS1, ADDRESS2, CITY, STATE, ZIP, EMAIL, PATIENT, PARENT, FAMILY, PHYSICIAN, OTHER) VALUES(@txtfname, @txtlname, @txtadd1, @txtadd2, @txtcity, @txtstate, @txtzip, @txtemail, @txtpatient, @txtparent, @txtfam, @txtphys, @txtother)"
c.Connection = strConn
c.CommandType = CommandType.Text
c.Parameters.Add("@txtfnam
e", SqlDbType.NVarChar).Value = txtfname.Text
c.Parameters.Add("@txtlnam
e", SqlDbType.NVarChar).Value = txtlname.Text
c.Parameters.Add("@txtadd1
", SqlDbType.NVarChar).Value = txtadd1.Text
c.Parameters.Add("@txtadd2
", SqlDbType.NVarChar).Value = txtadd2.Text
c.Parameters.Add("@txtcity
", SqlDbType.NVarChar).Value = txtcity.Text
c.Parameters.Add("@txtstat
e", SqlDbType.NVarChar).Value = txtstate.Text
c.Parameters.Add("@txtzip"
, SqlDbType.NVarChar).Value = txtzip.Text
c.Parameters.Add("@txtemai
l", SqlDbType.NVarChar).Value = txtemail.Text
c.Parameters.Add("@txtpati
ent", SqlDbType.Int).Value = txtpatient.Text
If (txtpatient.Text = "") Then
c.Parameters("@txtpatient"
).Value = DBNull.Value
Else
c.Parameters("@txtpatient"
).Value = txtpatient.Text
End If
c.Parameters.Add("@txtpare
nt", SqlDbType.Int).Value = txtparent.Text
If (txtparent.Text = "") Then
c.Parameters("@txtparent")
.Value = DBNull.Value
Else
c.Parameters("@txtparent")
.Value = txtparent.Text
End If
c.Parameters.Add("@txtfam"
, SqlDbType.Int).Value = txtfam.Text
If (txtfam.Text = "") Then
c.Parameters("@txtfam").Va
lue = DBNull.Value
Else
c.Parameters("@txtfam").Va
lue = txtfam.Text
End If
c.Parameters.Add("@txtphys
", SqlDbType.Int).Value = txtphys.Text
If (txtphys.Text = "") Then
c.Parameters("@txtphys").V
alue = DBNull.Value
Else
c.Parameters("@txtphys").V
alue = txtphys.Text
End If
c.Parameters.Add("@txtothe
r", SqlDbType.Int).Value = txtother.Text
If (txtother.Text = "") Then
c.Parameters("@txtother").
Value = DBNull.Value
Else
c.Parameters("@txtother").
Value = txtother.Text
End If
strConn.Open()
c.ExecuteNonQuery()
strConn.Close()
Response.Redirect("neuroth
anks.aspx"
)
End Sub
End Class