Hi..
Iam working on Asp.net appln I want to create classes for connection and use the objects of the connection in every form to establish a connection.
Please post me some details and information regarding this.
Jyo
hi jyoti
I am also new in asp.net. But it is very easy to create a class for connection.
i give u example. first imports all namesapce that is required for connection
-
imports system.data.oledb
-
class classname
-
dim con as oledbconnection
-
/* decalre all variable required for connection*/
-
/* you create mathods*/
-
public sub setcon()
-
con=new oledbconnection("your provider name")
-
end sub
-
/* similarly write all methods such as for inserting, retrieving,updateing the value*/
-
public sub insrecord(byval query as string)
-
cmd=new oledbcommand(query,con)
-
cmd.executenonquery()
-
end sub
-
end class
-
like this you declare all your method.
create an object of the class and used all methods