Click here to Skip to main content
15,905,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi how to create a function or class to get values from sql table in usercontrol while selecting perticular records to edit.
first i want to write class in usercontrol
and then i want to call that class in aspx.cs page.


in my project DID and DocType is common..so i want to get records using DID and DocType

please suggest me..

thank you.
Posted
Comments
[no name] 26-Jun-12 6:57am    
please elaborate more on this....
ythisbug 26-Jun-12 7:24am    
how to write a function inside usercontrol to show data from database..
??
[no name] 26-Jun-12 12:10pm    
it just the same how you do it for ASPX page.
Please implement the same....
ZurdoDev 26-Jun-12 8:02am    
This is a lot of questions and there are many, many ways to do it. First, create your control, then create a function that uses your SQL helper classes to call into the db. Then drag and drop your control onto a form and then call the function. It is way too much code to try and give you here. Please get started and then let us know where you get lost.
ythisbug 26-Jun-12 8:12am    
thanks..already i coded.but i want to write function inside tat usercontrol which i created to show data from database

1 solution

Create user control then create a function which load data from sql table then invoke this function from parent .aspx.cs file using

using: using System.Reflection;

Method invoke code:
MethodInfo mi = UserControl1.GetType().GetMethod("UserControlFunction");
mi.Invoke(UserControl1, null);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900