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
narasiman rao
NA
519
768.5k
i tried several times but it is not working the below code
Mar 16 2013 12:23 AM
Note it is windows application.
Run mode screen as follows;
Course Code Combo box
Datagridview as follows;
Days sess1 sess 2 sess3 sess4
1 checkbox checkbox checkbox checkbox
In Database record as follows;
courseCode Days sess1 sess2 sess3 sess4
REO 1 checkboxchecked checkboxchecked checkboxchecked checkboxchecked
REO 2 checkboxchecked checkboxchecked checkboxchecked checkboxchecked
Then i have one button in the run mode called Search Button when click the REO Course in the combo box, in the datagridview that particular course details to be displayed in the datagridview.
int irows;
try
{
sql = "select [Days],[Session1],[Session2],[Session3],[Session4] from Tb_Session_Structure where Cmn_Minor_code = '" + cb_Course_Code.Text.ToString() + "' order by [Days]";
dr = GFun.ReadAcessSql1(sql);
while (dr.Read())
{
for (irows = 0; irows < DGv_Session.RowCount; irows++)
{
DGv_Session.Rows[irows].Cells[1].Value = dr[1].ToString().Trim();
DGv_Session.Rows[irows].Cells[2].Value = dr[2].ToString().Trim();
DGv_Session.Rows[irows].Cells[3].Value = dr[3].ToString().Trim();
DGv_Session.Rows[irows].Cells[4].Value = dr[4].ToString().Trim();
}
}
dr.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error");
return;
}
when i click the search button, the output as follows in datagridview
courseCode Days sess1 sess2 sess3 sess4
REO 1 checkboxchecked checkboxchecked checkboxchecked checkboxchecked
but in the database two records are there, for the REO Course in Database days 1 and 2 record is there. but when i search for the REO Course the Days 1 record only shows.
why what is the problem?
from my search code what is the mistake? i tried but it is not working.
Regards,
Reply
Answers (
1
)
C# OLEDBConnection
hi please help me on this how to convert string to decimal