473,396 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Connectivity of asp.net with sqlserver2005 using vb.net

hi....to all respectable members.i m a beginner in .net.i want ur help.i am not able to make connectivity of asp.net with sqlserver.plz provide me help.m waiting
Feb 28 '07 #1
2 1108
junal
22
http://www.aquesthosting.com/HowTo/Sql2005/connect.aspx

hope it helps you !
Feb 28 '07 #2
<%@ Page Language="VB" Debug="true"%>
<%@ Import Namespace ="system.data"%>
<%@ Import Namespace ="system.data.sqlclient"%>
<%@ Import Namespace ="system.web.UI.webcontrols.datalist"%>
<%@ Import Namespace ="system.data.sqlclient.sqlconnection"%>
<%@ Import Namespace ="system.data.sqlclient.sqldatareader"%>
Public dbconn As New SqlConnection("Data Source=localhost;" & "database=database name;" & "Initial Catalog= database name;User ID=sa")
‘To open the database
dbconn.Open()
‘to close the database
dbconn.close()
‘ to fetch the records from the table
dim sSql as string
sSql = "select * from userlogin”
Dim cmd As New SqlCommand(sSql, dbconn)
Dim reader12 As SqlDataReader = cmd.ExecuteReader()
If (reader12.HasRows) Then
While reader.read()
Username.text = reader("username”)
Password.text=reader(“password”)
End while
Mar 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the...
3
by: Niks | last post by:
Hi, I need to connect to SQL server Database using a System DSN. Can anyone tell me how to connect to SQL Server using DSN in ASP.NET (VB.Net). Using a Try Catch block. Does anyone know how to...
2
by: Mark Olbert | last post by:
Why does the following simple query against an SqlServer2005 table in an ASPNET2 website returning less than 10 rows: SELECT link_text, idnum, ts FROM bd_content WHERE parent_id = 0 AND idnum <> 1...
3
by: DrinkyBanjo | last post by:
All I need to write a paper in my VB .NET class about the importance of the connectivity of VB to a database. Would you know of any websites to visit that would discuss this in detail? ...
2
by: Vinayagamurthy | last post by:
If it is possiable to send an SMS from SQLServer2005 to MobilePhone using any extended stored Procedures. Otherwise we can able to create any Stored Procedures for sending sms.
2
by: red_valsen | last post by:
I have a default installation of SQLServer2000 on a host running Win2003. I want to install SQLServer2005 on the same machine, but preserve the original SQLServer2000 installation. How do I do...
4
by: Mark Olbert | last post by:
I'm looking for help in getting the Transfer Sql Server Objects task to work. The goal is to transfer the tables, views, sprocs, udfs from a SqlServer 2000 database to a Sql Server 2005 database. ...
1
by: yasinirshad | last post by:
HI, Can anyone tel me How to copy data from a table in one database to a table in another database using sqlserver2005. Thanks in advance.
2
by: senthilnova | last post by:
hi, i am beginner in C#. i got an error in connecting with sqlserver2005 as" "The connection string property has not been initialized". I wrote the connection settings for a button click event as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.