Hi, I have been using .NET 2008 since the last 2 yrs. I can give you the example of a code using connection as i have used it in many of my applications. Actions like add update delete can be per formed using unbound control. Just try to follow what I write. In case any more difficulty you can mail me at 'ritwesh.chatterjee@gmail.com'.
Here is my example :
con = new OledbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data source = [as required]");
con.open();
cmd=con.CreateCommand();
cmd.CommandText="Selct * from [table_name]";
dr=cmd.ExecuteReader();
if(dr.Read())
{
}
else
{
}
The above code establishes connection with the data base of microsoft access. The connection coding will be same for every program. But to perform operations like update add delete you have to use their respective sql coding in the Command Text. I am giving you below a list of such sql coding :
FOR ADDING ROWS INTO THE DATABASE TABLE
cmd.CommandText="Insert into [table_name] values ([values_for_inserting_as_per_columns_from_left_to_right.]";
cmd.ExecuteNonQuery();
In the above coding you have to insert values from left to right as per your columns in the table. Yes, one important thing. You have to give every value separated by a comma(,)and enclose the string values in single quotes(' ') and for numeric values don't use any quotes but make sure that you keep the data in the numeric format exactly as your format in the column of the data table and use .ToString() after writing the value. This format is to be followed for all other coding.
FOR DELETING A ROW :
cmd.CommandText = "Delete from [table_name] where [column_for_criteria] = [value]";
cmd.ExecuteNonQuery();
I hope this helps you.