THANKS MAJITH SIR FOR HELPING ME!! PLZZZ CAN U HELP ME MORE ?

Posted by AMOL under ASP.NET on 10/10/2008 | Views : 1906 | Status : [Member] | Replies : 1
HELLO ,
THNKS FOR GIVING ME A SOURCE CODE FOR A MAIL SERVICE.
BUT MY PROJECT IS ON ONLINE ADMISSION FORM AND TRYING TO CONNECT TO SQL SERVER 2005 USING THE "VISUAL WEB DEVELOPER TOOL 2008" CAN I PLZ GET SOME MORE HELP ON THIS TOPIC PLZ SIR I REQUEST U HUMBLY.I AM TOTALLY NEW TO THIS TOOL SO DON'T KNO TO USE THE APPROPRIATE FIELDS IN THE WEBSITE FOR ONLINE ADMISSION USING "VWD 2008".
CONNECTING TO SQL SERVER 2005 CAN I GET THE SAMPLE SOURCE CODE FOR THE SAME PROJECT MENTIONED ABOVE. PLZZ HELP ME I BEG OF U !!!!!!!
n.b:--- GIVE ME THE SAMPLE APPLICATION FORM'S WEBSITE ALONG WITH LOGIN PAGE AND FORM WITH DATABASE CONNECTION ON SQL SERVER 2005 ON VISUAL WEB DEVELOPER TOOL 2008.
PLZZZZ HELP ME!!!!
THANKING YOU !!!!!!




Responses

Posted by: Majith on: 10/12/2008 [Member] Starter

Up
0
Down

Imports System.Data
Imports System.Data.OleDb

Partial Class [Default]
Inherits System.Web.UI.Page
Const cons1 As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\sam2.mdf;Integrated Security=True;User Instance=True"


#Region " Web Form Designer Generated Code "

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

End Sub


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 Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'On Error GoTo so

Try

'Dim cn As New SqlConnection(cons1)
Dim s, s1 As String
Application("sign") = TextBox1.Text
s1 = TextBox1.Text

's = "select * from " & s1 & " "
s = "select * from usr where uid = '" & TextBox1.Text & "' and pass = '" & TextBox2.Text & "'"
cn.Open()

Dim dr As OleDbDataReader

Dim cmd As New OleDbCommand(s, cn)
'cmd = New OleDbCommand(s, cn)
dr = cmd.ExecuteReader

If dr.Read = True Then

' Application("sign") = dr("cid")

Response.Redirect("Frameset1.htm")

Else
Server.Transfer("Invalid.aspx")
End If
cn.Close()
Catch ex As Exception
Label1.Text = " Invalid Details"
End Try

End Sub
End Class


refer the const variable here iam refering the database sam2.mdf (SQLSERVER 2005) this is login page code


AMOL, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response