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
Sachin Mitna
NA
20
1.4k
How can i am Add sqlData Base values in gridview dropdown list ....
Oct 2 2020 11:57 PM
if (!IsPostBack)
{
SetIntailRow();
// SetGrid();
this.BindGrid();
}
SqlConnection con = new SqlConnection(@"Data Source=AQSASHAIKH\SQLEXPRESS;Initial Catalog=Client;Integrated Security=True");
string com = "Select * From [dbo].[client]";
SqlDataAdapter da = new SqlDataAdapter(com, con);
DataTable dt = new DataTable();
da.Fill(dt);
DropDownList1.DataSource = dt;
DropDownList1.DataBind();
DropDownList1.DataTextField = "Name";
DropDownList1.DataValueField = "id";
DropDownList1.DataBind();
SqlConnection Conn = new SqlConnection(@"Data Source=AQSASHAIKH\SQLEXPRESS;Initial Catalog=Client;Integrated Security=True");
SqlCommand Comm1 = new SqlCommand(com, Conn);
Comm1.Connection = Conn;
Comm1.CommandText = "SELECT COUNT(*) FROM client";
Conn.Open();
TxtBox1.Text = Comm1.ExecuteScalar().ToString();
TxtBox2.Text = Comm1.ExecuteScalar().ToString();
Conn.Close();
}
Reply
Answers (
4
)
Bind Checkbox in MVC using Jquery
add assembly reference