S
semesm22
hello all, i am new to ASP.NET, and sessions....and i would like to do
the following....i have a ConnectDB class, that imports system.data.ole,
and i have the OleConnection, and OleCommand, and a SQL string as a
property in that class....the idea is that i can set the SQL property
from any web form, and call a login method that will connect to the
datebase and select * from client, for example, and put the data in a
Dataset.....what i would like to do is to add this dataset to the
session object, so that i can check to see if there were records found
in the database from the web form that called the Login method...here is
the code i m using, cause i don't think i'm explaining this well!!!
public class ConnectDB
*** i nitialize the connection string, and the OleConnection,
OleCommand, and DataAdapter here***
public sub Login()
'SQL statment set from any page
OleCommand.CommandText = me.SQL
OleCommand.Connection = OleConnection
try
OleConnection.Open
dim myDataset as new Dataset
DataAdapter.Fill(myDataset)
catch
end try
end class
*************************************************************
now what i would like to do is to assign myDataset to a session
object....is this even possible?, if so, how can i do that? if not, then
what is a better solution?
************************************************************
public class WebForm1
private sub Login_Click()
dim myConnectDB as new ConnectDB
myConnectDB.SQL = "select * from client where name = '" & txtName.text &
"'"
myConnectDB.Login
end class
PLEASE HELP
thank you
sam
the following....i have a ConnectDB class, that imports system.data.ole,
and i have the OleConnection, and OleCommand, and a SQL string as a
property in that class....the idea is that i can set the SQL property
from any web form, and call a login method that will connect to the
datebase and select * from client, for example, and put the data in a
Dataset.....what i would like to do is to add this dataset to the
session object, so that i can check to see if there were records found
in the database from the web form that called the Login method...here is
the code i m using, cause i don't think i'm explaining this well!!!
public class ConnectDB
*** i nitialize the connection string, and the OleConnection,
OleCommand, and DataAdapter here***
public sub Login()
'SQL statment set from any page
OleCommand.CommandText = me.SQL
OleCommand.Connection = OleConnection
try
OleConnection.Open
dim myDataset as new Dataset
DataAdapter.Fill(myDataset)
catch
end try
end class
*************************************************************
now what i would like to do is to assign myDataset to a session
object....is this even possible?, if so, how can i do that? if not, then
what is a better solution?
************************************************************
public class WebForm1
private sub Login_Click()
dim myConnectDB as new ConnectDB
myConnectDB.SQL = "select * from client where name = '" & txtName.text &
"'"
myConnectDB.Login
end class
PLEASE HELP
thank you
sam