Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2008, 04:03 AM
Registered User
 
Join Date: Jun 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to SQL Server

hi, i'm doing doing a proj that require user to login to the system.
i'm using Vb.net 2005 and SQL Server 2005 as my database.

login information are suppose to be verify from the table in the server. can any1 give me an example or comments how can i do it?

        Dim conn As SqlConnection
        Dim cmdLogin As New SqlCommand
        Dim daLogin As New SqlDataAdapter
        Dim dsLogin As New DataSet
        Dim dtLogin As New DataTable

        conn = New SqlConnection("Server=" & ServName & "; Database=EISTUDFD; User ID=" & ServUID & " ; Password=" & ServPasswd & ";")
        conn.Open()

        cmdLogon = conn.CreateCommand
        cmdLogon.CommandText = "Select Username,Password,from Login where Username = '" & Trim(txt_UserName.Text) & "' and Password = '" & Trim(txt_Password.Text) & "'"
        daLogon.SelectCommand = cmdLogin






Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to sql server Scripts82 SQL Server 2000 1 March 27th, 2006 10:07 PM
URGENT:Connecting SQL server through Proxy server abhowal Pro VB Databases 2 January 9th, 2006 01:47 PM
URGENT:Connecting SQL server through Proxy server abhowal SQL Server 2000 3 November 30th, 2005 04:22 AM
URGENT:Connecting SQL server through Proxy server sankar SQL Server 2000 0 August 26th, 2003 03:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.