Not 100% sure what you're really asking for :-), but assuming you're interested in knowing how to programatically execute a SQL query, you'll need (assuming SQL Server as the backend):
- a "using System.Data;" and "using System.Data.SqlClient;" using clause
- a "SqlConnection" object to establish your connection to SQL Server (usually combined with a ConnectionString, stored in some form of a config file)
- a "SqlCommand" object to formulate your SQL query and execute it
- some way of dealing with possible results from that query
You'll have something like:
SqlConnection connection = new SqlConnection(-connection string-);
SqlCommand command = new SqlCommand("...your sql query here...", connection);
connection.Open();
command.ExecuteScalar / command.ExecuteReader / command.ExecuteNonQuery
(depending on your needs)
connection.Close();
plus of course, some error handling.... :-)
Does that help that at all??