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
habib ullah
NA
229
14.1k
i have a searching in database if record not found then mess
May 16 2017 2:33 AM
we make a searching in database if the record is not found then show the message "sorry record is not found" how i can do it help me solve problem my code is that
if (ds.Tables["tbl_transaction"].Rows.Count > 0)
{
label1.Text = "sorry record not found";
}
else
{
ds = cls.loaddataset("select * from tbl_expdtl where e_date = '" + dateTimePicker2.Text + "'", "tbl_expdtl");
object query = cls.getspecefisrecord("select sum(amount) from tbl_expdtl where e_date='" + dateTimePicker2.Text + "'");
lbl_show.Text = Convert.ToString(query);
dataGridView3.Rows.Clear();
for (int b = 0; b <= ds.Tables["tbl_expdtl"].Rows.Count - 1; b++)
{
dataGridView3.Rows.Add();
dataGridView3.Rows[b].Cells[0].Value = ds.Tables["tbl_expdtl"].Rows[b]["p_id"];
dataGridView3.Rows[b].Cells[1].Value = ds.Tables["tbl_expdtl"].Rows[b]["expence"];
dataGridView3.Rows[b].Cells[2].Value = ds.Tables["tbl_expdtl"].Rows[b]["amount"];
dataGridView3.Rows[b].Cells[3].Value = ds.Tables["tbl_expdtl"].Rows[b]["remarks"];
dataGridView3.Rows[b].Cells[4].Value = ds.Tables["tbl_expdtl"].Rows[b]["e_date"];
this.dataGridView3.RowsDefaultCellStyle.BackColor = Color.Bisque;
this.dataGridView3.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
}
}
Reply
Answers (
4
)
Master Page not Showing Content Page
Crystal Report Memory Full Error