Last post Jan 10, 2014 05:04 PM by smirnov
Jan 10, 2014 02:15 PM|emaak|LINK
i have two webforms .webform1 and webform2
startdate txbx (date populates in labels below linkbtns) 01/02/2014
enddate txbx 01/07/2014
if user click on tueslinkbtn
okbtn//user clicks save in database (a,b,c)
depending updon user clicks sunlinkbtn or monlinkbtn it get data from database and populate into regarding textbox
string Connection = System.Configuration.ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;
SqlConnection cn = new SqlConnection(Connection);
string strcmd = "select Services from DetailsTable where date =@Services ";
SqlCommand command1 = new SqlCommand(strcmd, cn);
command1.Parameters["@Services"].Value = txt_StartDate.Text;
dr = command1.ExecuteReader();
var count = dr.FieldCount;
txt_ServiceMonday.Text = "";
for (int i = 0; i < count; i++)
txt_ServiceMonday.Text += dr.GetValue(i) + ",";
above code i plave in startdatetextbox so whenever i click on that it display only in one textbox.waht modification do i need to do
Jan 10, 2014 03:34 PM|smirnov|LINK
waht modification do i need to do
It is clear that you have 2 web forms but it is not clear what you want to do with them. Can you maybe provide some more details regarding your problem?
Jan 10, 2014 04:36 PM|emaak|LINK
in webform2 employee select some dropdown services hits okbtn it stores in databse and redirects to webform1.Iwant to display dropdown values should be displayed in textbox .
example: in timesheet employee selects different projects when closes the form those projects are diplayed in main page something like this(in my program employee enters data into database and saves after he closes form display those values into main
Jan 10, 2014 05:04 PM|smirnov|LINK
select some dropdown services hits okbtn it stores in databse and redirects to webform1.
If you save data in the database and then want to show data from the database on other form then you simply need to query database, get data and show on the form.
You already have some code with query
"select Services from DetailsTable where date =@Services ";
If I understand it correct you now need to have
"select something from SomeTable where userid=@userid";