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
firas shaar
NA
15
17.8k
how to fetch all rows inserted in datagridview in c#
Sep 14 2014 12:23 PM
I fetch maxid row to view in datagridview using the following code
public static DataTable GetMaximpID()
{
string strconn = AlShehabi.Properties.Settings.Default.NewSalariesDBConnectionString;
SqlConnection conn = new SqlConnection(strconn);
if (conn.State == ConnectionState.Closed)
{
conn.Open();
}
SqlCommand command = new SqlCommand("select * from Imprests where Imprest_ID= (Select MAX(imprest_ID) FROM Imprests)", conn);
SqlDataAdapter adpater = new SqlDataAdapter(command);
DataTable dt = new DataTable();
try
{
adpater.Fill(dt);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
conn.Close();
return dt;
}
but I want to fetch all rows inserted and view in datagridview
for example if user insert 4 rows I want to view them in datagridview after insert them
using insertbutton_click
Reply
Answers (
0
)
how to delete multirows
Is the args in CMD line i.e. String args[] an array