4
Answers

Add combobox to dataGridView

Dealy

Dealy

10y
1.3k
1
Hello,
 
I load data from a database into a dataGridView. How can I set one of the columns to combobox that loads data from a stored procedure?
Here's my code for loading data:
 
using (conn = new SqlConnection(connectionString))
{
SqlCommand cmd = new SqlCommand("SELECT_TASKS", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@UserID", System.Environment.UserName));
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
tasksGridView.DataSource = dt;
}
conn.Close();
 
Thank you in advance. 
Answers (4)
0
Hirendra Sisodiya

Hirendra Sisodiya

NA 8.8k 3m 14y

hello ali
If you know that a log file contains unused space that you will not be needing, than you can reduce the size of the transaction log. this is  known as shrinking the log file. (you can got to MSDN: http://msdn.microsoft.com/en-us/library/ms178037.aspx)
Shrinking can occur only while the database is online.
open your sql management studio--> Right click on database--> goto task--> shrink --> files than shrink files dialog box will be open you can select Filetype as 'log' and can see neccessary information about log file,select shrink action and click on 'OK'.
Shrink process.JPG
thanks
Please mark as answere if it helps