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
ghasem deh
NA
258
40k
display dataBase (cells) in listBox
Jan 18 2015 4:45 AM
hi ...
i want display 2 cells from Table (Tsel) in listBox Where Date in record = Today Date
and use this code :
public DataTable SelectData()
{
string selectQuery = "Select Cam From Tsel Where Dat LIKE @d";
SqlCommand Command1 = new SqlCommand(selectQuery, this.con);
Command1.Parameters.AddWithValue("@d", toolStripStatusLabel13.Text);
SqlDataAdapter DataAdapter1 = new SqlDataAdapter(Command1);
try
{
DataTable result = new DataTable();
DataAdapter1.Fill(result);
return result;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return null;
}
finally
{
Command1.Connection.Close();
}
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
this.listBox1.DataSource = this.SelectData();
this.listBox1.DisplayMember = "Cam";
this.listBox1.ValueMember = "Dat";
}
catch
{
}
butt not happen !
Reply
Answers (
1
)
retrieve data from biometric attendance machine
How to print all output of a program in text file in C++?