Advertisement
Advertisement
| 01.04.2008 at 10:10AM PST, ID: 23059286 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: |
Protected Sub btnTest_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnTest.Click
Dim retFirstName As String = ""
Dim retLastName As String = ""
Dim retDOB As Date = "01/01/1900"
Dim retSSN4 As String = Me.txtSSN4.Text
Dim RSVP As String = "0"
Dim DBConn As New SqlConnection("UID=dmegnin;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SYEP2007;Data Source=BETASERVE;Packet Size=4096;")
Dim sql1 As String = "SELECT FirstName FROM Applicants WHERE SUBSTRING(SSN, 6, 4)= 8980; "
Dim sql2 As String = "SELECT LastName FROM Applicants WHERE SUBSTRING(SSN, 6, 4)= 8980; "
Dim sql3 As String = "SELECT DOB FROM Applicants WHERE SUBSTRING(SSN, 6, 4)= 8980; "
Dim sql4 As String = "SELECT SUBSTRING(SSN, 6, 4) FROM Applicants WHERE SUBSTRING(SSN, 6, 4)= 8980; "
Dim Cmd As New SqlCommand
Dim DBCmd As New SqlCommand(sql1, DBConn)
Dim DBAdap As New SqlDataAdapter(DBCmd)
Dim DS As New DataSet()
DBConn.Open()
'Cmd.Parameters.Add("@SSN4", SqlDbType.VarChar, 4)
'Cmd.Parameters("@SSN4").Value = txtSSN4.Text
Try
Me.retFirstName.Text = DBCmd.ExecuteScalar().ToString()
Me.retLastName.Text = New SqlClient.SqlCommand(sql2, DBConn).ExecuteScalar().ToString()
Catch exp As Exception
Response.Write(exp)
End Try
DBCmd.Dispose()
DBAdap.Dispose()
DBConn.Close()
DBConn = Nothing
End Sub
|