I know how to do inserts with a windows app but this is my first web app and I have not had alot of luck. I have a form with lots of textboxs and a submit button. For trial purposes, I am only going to submit 3 of the textboxes. Here is the code,
VB Code:
  1. Imports System.data.sqlclient
  2. Imports System.Data
  3.  
  4. Public Class Identification
  5.     Inherits System.Web.UI.Page
  6.  Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
  7.        
  8.  
  9.         Dim cnCF98 As New SqlConnection
  10.  
  11.         cnCF98.ConnectionString = "integrated security=true;initial catalog=tempdb"
  12.         cnCF98.Open()
  13.  
  14.         Dim cmdtext As String = "Insert ID ( SN, Surname, Given) VALUES  (" & txtSN.Text & ", " & txtSurname.Text & ", " & txtGiven.Text & " )"
  15.         Dim cm As New SqlCommand(cmdtext, cnCF98)
  16.         cm.ExecuteNonQuery()
  17.         cnCF98.Close()
  18. End Sub
  19. End Class
I get this error -
Server Error in '/WebApplication1' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
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.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error:


Line 110:
Line 111: cnCF98.ConnectionString = "integrated security=true;initial catalog=tempdb"
Line 112: cnCF98.Open()
Line 113:

Line 112 is in red. I am sure this is probably a security setup problem but have had no luck. I have added the
<identity impersonate="true" /> to the webconfig file but no luck with that either. Any help would be a good thing.