Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi everyone..
my table contains
ID    waName      waProID    Date              Allocater
6	11	DU/0005	3/15/2012	Administrator
7	11	DU/0006	3/28/2012	Administrator
8	10	DM/0005	3/28/2012	Administrator

and in my aspx page contains
dropdowns[ddlwaProID] if i select from this record in TextBox i want to display Allocater Name..

can any one suggest me?just want to display in Text Box..
wat i have to do..i have to create sp?or only query s enough?


thanks and regards..
Posted
Comments
ythisbug 22-Mar-12 3:08am    
let me knw if your not undertand my question..thanks

1 solution

Dear Friend,

Have you tried something earlier. If not then try atleast and then if you face some problem then do share your problem with us here.

You can go either way means, making a SP or writing a query will do but SP will be preferable.

Thanks
 
Share this answer
 
Comments
ythisbug 22-Mar-12 5:33am    
int Value=Convert.ToInt32(ddlTestCase.SelectedValue.ToString());
DataSet ds=new DataSet();
SqlConnection con = new SqlConnection();
SqlDataAdapter da = new SqlDataAdapter();
con.ConnectionString = ConfigurationManager.ConnectionStrings["MyConStr1"].ConnectionString;
SqlCommand cmd = new SqlCommand();
con.Open();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select AllocaterName from WorkAllocated where ID=" + Value;
//SqlDataAdapter da =new SqlDataAdapter("select AllocaterName from WorkAllocated where ID=" + Value);
da.Fill(ds);


if(ds.Tables[0].Rows.Count >0)
{
lblAllocater.Text=ds.Tables[0].Rows[0]["AllocaterName"].ToString();
}

this i tried.but m getting error near da.Fill(ds);
Varun Sareen 25-Mar-12 20:47pm    
what error?

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