Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i do know how to connect sql database into this project.so, please explain what are the steps are fllowed.

What I have tried:

my final year project.i will try connect the data base into your project
Posted
Updated 18-Mar-16 0:57am
Comments
Sascha Lefèvre 18-Mar-16 6:40am    
Please take a look at the numerous articles here on CodeProject describing database connectivity.

1 solution

Simplest way:
C#
using (SqlConnection con = new SqlConnection(strConnect))
    {
    con.Open();
    using (SqlDataAdapter da = new SqlDataAdapter("SELECT MyColumn1, MyColumn2 FROM myTable WHERE mySearchColumn = @SEARCH", con))
        {
        da.SelectCommand.Parameters.AddWithValue("@SEARCH", myTextBox.Text);
        DataTable dt = new DataTable();
        da.Fill(dt);
        // Use the datatable data.
        }
    }
Other than that, we can't say - we don't even know what environment your project is going to run in, much less what it will do.
But...if this is your final year project, then you should know how to use a DB in your code already, unless you haven't paid any attention during the course so far...
 
Share this answer
 

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