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
ancy chacko
NA
71
18.3k
Error in binding dropdownlist in asp.net
Feb 27 2015 9:15 AM
i want to bind value in dropdownlist. but i can't insert that data in another table.
public void Funcdivision()
{
// Dpdivisn.Items.Add(new ListItem("--Select --", ""));
// Dpdivisn.AppendDataBoundItems = true;
MySqlDataAdapter da = new MySqlDataAdapter("Select distinct Divisions from tbl_divisions", cn);
DataTable dt = new DataTable();
da.Fill(dt);
Dpdivisn.DataSource = dt;
Dpdivisn.DataValueField = "Divisions";
Dpdivisn.DataBind();
Dpdivisn.Items.Insert(0, new ListItem("--Select--", "0"));
//Dpdivisn.Items.Insert(0, "Select");
}
cn.Open();
string str2 = "insert into tbl_organization values('" + lblempcode.Text + "','" + Dpgroup.SelectedItem.Text + "','" + ddplegal.SelectedItem.Text + "','" + Dpdivisn.SelectedItem.Text + "','" + Dplocation.SelectedItem.Text + "','" + Dpdepartment.SelectedItem.Text + "','" + DropDownList6.SelectedItem.Text + "','" + Dpdesign.SelectedItem.Text + "','" + DpProject.SelectedItem.Text + "','InActive','" + DropDownList7.SelectedItem.Text + "')";
MySqlCommand Cmd2 = new MySqlCommand(str2, cn);
Cmd2.ExecuteNonQuery();
cn.Close();
inserting is not working
Reply
Answers (
2
)
What is Razor Syntax
MSSQL passwords stored inside web.config