
n when i click on show button:
code for dat is :
string con = "Server=.\\SQLEXPRESS;Database=db1.mdf;Trusted_Connection=True;";
SqlDataAdapter da = new SqlDataAdapter();
private void btnshow_Click(object sender, EventArgs e)
{
string q = "select * from items where cname= " + "'" +comboBox1.SelectedValue.ToString() + "'";
textBox1.Text = comboBox1.SelectedValue.ToString();
da = new SqlDataAdapter(q, con);
DataSet ds = new DataSet();
da.Fill(ds);
dataGrid1.DataSource = ds;
}
string con = "Server=.\\SQLEXPRESS;Database=db1.mdf;Trusted_Connection=True;";
SqlDataAdapter da = new SqlDataAdapter();
private void btnshow_Click(object sender, EventArgs e)
{
string q = "select * from items where cname= " + "'" +comboBox1.SelectedValue.ToString() + "'";
textBox1.Text = comboBox1.SelectedValue.ToString();
da = new SqlDataAdapter(q, con);
DataSet ds = new DataSet();
da.Fill(ds);
dataGrid1.DataSource = ds;
}
bt i get error at runtime on the statement
da.Fill(ds);Error:ErrorUnable to copy file "D:\WindowsApplication2\WindowsApplication2\db1_log.ldf" to "bin\Debug\db1_log.ldf".The process cannot access the file 'D:\WindowsApplication2\WindowsApplication2\db1_log.ldf' because it is being used by another process. WindowsApplication2N when i stop the program this error continue to occur while building..
but when i restart my computer this error gone..
whts the reason??
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Lalit MPosted Jan 21, 2010, 5:20 AM
http://weblogs.asp.net/ngur/archive/2004/02/23/78184.aspx
http://social.msdn.microsoft.com/Forums/en/vbide/thread/cd12f3c7-de96-4353-adce-23975e30933f