TelerikRadGrid how to insert, update and delete into SQL database

I use Telerik controls in Visual Studio 2008, in RadGrid. I create PopUp windows, including all the text fields and controls that I need to use in the database, but how can I declare a function to insert, update, and delete? And where!?

+1
source share
1 answer

You can use the Data Access Level to determine the function of sending a request to the database

If you want to use SQL Server. Below is the code.

using (System.Data.SqlClient.SqlConnection con = new SqlConnection("YourConnection string")) { 
    con.Open(); 
    SqlCommand cmd = new SqlCommand(); 
    string expression = "Parameter value"; 
    cmd.CommandType = CommandType.StoredProcedure; 
    cmd.CommandText = "Your Stored Procedure"; 
    cmd.Parameters.Add("Your Parameter Name", 
                SqlDbType.VarChar).Value = expression;    
    cmd.Connection = con; 
    using (IDataReader dr = cmd.ExecuteReader()) 
    { 
        if (dr.Read()) 
        { 
        } 
    } 
}

You can also use Microsoft Enterprise Library

Business Logic Layer , Presentation Layer

, - Presentation Layer

0

All Articles