e premte, 15 qershor 2007

Basics of coding

Basics of coding



Code to establish Sql Connection

imports system.data.sqlclient                                         // importing class library

dim con as new sqlconnection("server=.;uid=sql userid;pwd=sqlpassword;database=databasename")


'con'    means  connection name(You can give any name)

Code to declare an sql command

dim cmd as new sqlcommand("",con)


Code to declare  sqldata adapter

dim ada as new sqldataadapter(cmd)


Code to declare datatable & dataset


dim dt as new datareader
dim ds as new dataset


Code to declare datareader

Dim dr As SqlDataReader

***We are not creating a new datareader..so there is no 'new' command in the above code

Where to write this code










1 koment:

Midhun Harikumar tha...

Can u give the vb.net code for writing a binary file...


http://tips-on-security.blogspot.com/

http://www.orkut.com/Profile.aspx?uid=11308356365688312513