Click here to Skip to main content
15,902,032 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
SqlConnection cn = new SqlConnection("Data      Source=.\\SQLEXPRESS;AttachDbFilename=F:\\Database.mdf;Integrated Security=True;User      Instance=True");
            SqlCommand cmd = new SqlCommand("SELECT * FROM stu1", cn);
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            adp.Fill(ds);
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();
Posted
Updated 25-Jun-13 1:16am
v2
Comments
Sergey Alexandrovich Kryukov 25-Jun-13 1:54am    
Drive?! Are you aiming to produce a single-use software?
—SA
manthan11 25-Jun-13 2:19am    
yes
Jim Jos 25-Jun-13 2:48am    
Do you have a UNC name for the dive?.. \\servername\directory etc..?
[no name] 25-Jun-13 6:10am    
Not even a question. Just a code dump.
sjelen 25-Jun-13 7:21am    
What is the problem? What error/exception are you getting?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900