TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
muthukumar
NA
0
100.9k
three tier architecture
Jan 6 2014 4:33 AM
i use a registration form in that based on one ddl1 it generate another ddl2
my problem is i using these in three tier architecture i dont know how to bind the ddl2 based on ddl1 .selectedvalue
here is my code 1.DAL.cs, 2.BAL.cs 3.registration form .cs
ddl ID="ddlstate"
1.DAL.cs
public DataTable Bind_ddlCity()
{
try
{
con = new SqlConnection(s);
con.Open();
string qry = "select state, from cntryandstate where cntry ='" + dd + "'";
cmd = new SqlCommand(qry, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
catch
{
throw;
}
finally
{
cmd.Dispose();
con.Close();
con.Dispose();
}
}
2.BAL.Cs
public DataTable Bind_ddlCity()
{
try
{
return obj.Bind_ddlCity();
}
catch
{
throw;
}
finally
{
//obj = null;
}
}
3 .registration form .cs
private void Bind_ddlCity()
{
DataTable ret;
ret = obj.Bind_ddlCity();
if (ret.Rows.Count != 0)
{
ddlstate.DataSource = ret;
ddlstate.DataTextField = "state";
ddlstate.DataValueField = "cntry";
ddlstate.DataBind();
}
Reply
Answers (
1
)
Differences beween the two Excel Sheets
in three tier how to populate ddl based on another ddl selec