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
Ron Aricha
1.7k
52
2.2k
Add string to DataSet
Dec 8 2018 5:02 AM
Hello,
I want to add to the DataSet in the highlighted line a variable of type string
How to do this?
private void fillExamList()
{
string selectExamination = "SELECT ExamType.ExamTypeString, FullName, ExamDate, ExamCode FROM ExamType INNER JOIN Examination ON ExamType.ExamType = Examination.ExamType WHERE PatientID = " + txtSearchID.Text + "";
SqlDataAdapter da = new SqlDataAdapter(selectExamination, conn);
DataSet ds = new DataSet();
try
{
conn.Open();
da.Fill(ds);
ds.Tables[0].Columns.Add("ExamList", typeof(string), "FullName + ', ' + ExamTypeString");
ddlExamList.DataValueField = "ExamCode";
ddlExamList.DataTextField = "ExamList";
ddlExamList.DataSource = ds;
ddlExamList.DataBind();
ddlExamList.Items.Insert(0, new ListItem("Select...", "0"));
}
catch (Exception ex)
{
ErrorHandling(ex.ToString());
}
finally
{
conn.Close();
}
}
Reply
Answers (
4
)
PDF MERGE Without page size
insert mutiple dynamically generated controls