By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,894 Members | 1,790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,894 IT Pros & Developers. It's quick & easy.

Accessing C# classs file to Page_Load Event

P: 17
I have written a C# class file with database connection and to retrieve the data through a GridView. But now i am not able to get the data throught that Class file in an Page_load() event. Does anybody knows the codings to dispaly the class details of the same.

My class Code is Like this:
public void Get_Data()
SqlConnection SConn =new SqlConnection("ConnectionStringl");

DataSet Ds = new DataSet();
SqlCommand Scmd = new SqlCommand("select * from user_details",SConn);
SqlDataAdapter Sa = new SqlDataAdapter(Scmd);
Sa.Fill(Ds, "user_details");
GridView1.DataSource = Ds;

Now i want to display this details through page..
Kindly let me know the code

With Regards
Feb 2 '08 #1
Share this Question
Share on Google+
1 Reply

P: 3
Did you put the .cs file in the App_Code directory?
Feb 2 '08 #2

Post your reply

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