Simple CRUD Operation Asp.Net c# With SQL Server | swift learn



Simple CRUD Operation Asp.Net c# With SQL Server | swift learn

Simple CRUD Operation Asp.Net c# With SQL Server | swift learn

In this tutorial you can learn Complete CRUD(Create, Retrieve, Update, Delete) Operation project in asp.net c# with SQL Server.
I also include error solution in this tutorial so that you can understand how to solve error in asp.net project.
Just follow this steps-
1. Create a new Asp.Net project.
2. Design the project with Label, TextBox, RadiobuttonList, DropdownList and button control.
3. Create database and table in SQL Server using Object Explorer.
4. Connect sql server with visual studio using Server Explorer.
5. Write code to execute CRUD operation in asp.net.
6. Debug and test.

Prerequisites.
You should have installed sql server and visual studio. you can use sql server integrated with visual studio instead of SQL Server management studio.

This tutorial also covered-
1. Creating new asp.net website in visual studio.
2. Creating sql server database and table.
3. Creating method in c#.
4. Calling method in other event.
5. How to load data in GridView.

Follow this code to perform insert update delete search operation in asp.net c#

SqlConnection connection = new SqlConnection(“Data Source=catalog-svr;Initial Catalog=CRUDTutorialDB;User ID=sa;Password=row@129”);
protected void Button1_Click(object sender, EventArgs e)
{
int empid = int.Parse(TextBox1.Text);
string empname = TextBox2.Text, city = DropDownList1.SelectedValue, sex = RadioButtonList1.SelectedValue, contact = TextBox5.Text;
double age = double.Parse(TextBox3.Text);
DateTime jdate = DateTime.Parse(TextBox4.Text);
connection.Open();
SqlCommand command = new SqlCommand(“Insert into EmployeeSetup_Tab values (‘”+empid+ “‘,'” + empname + “‘,'” + city + “‘,'” + age + “‘,'” + sex + “‘,'” + jdate+ “‘,'” + contact + “‘)”, connection);
command.ExecuteNonQuery();
connection.Close();
ScriptManager.RegisterStartupScript(this, this.GetType(), “script”, “alert(‘Successfully saved’);”, true);
GetEmployeeList();
}

void GetEmployeeList()
{
SqlCommand command = new SqlCommand(“Select * from EmployeeSetup_Tab”, connection);
SqlDataAdapter sd = new SqlDataAdapter(command);
DataTable dt = new DataTable();
sd.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
~~~~~~~~~~~~~
Subscriber will be notified when I will upload new tutorials in future. Many more new tutorials coming soon, so stay tuned!
https://www.youtube.com/swiftlearn

~~~~~~~~~~~~~
You can also know all the programming techniques, and bug fixing, error solution in my channel Swift learn.
The main topics of this cnannel are c#.net, asp.net,VB.Net WCF, sql server, crystal report, RDLC report, HTML, CSS, javascript, Android etc.
See All the playlist in below link
https://www.youtube.com/swiftlearn/Playlists
~~~~~~~~~~~~~
Share this video with anyone if you think as useful.
Please leave a suggestions for future tutorials in the comment section below.
~~~~~~~~~~~~~
Connect with me
https://www.facebook.com/groups/swiftlearn/

More Tags
#SimpleCRUDOperationAsp.Net #CRUDOperationAsp.Net #SwiftLearn

swift learn,crud in asp.net c# with sql,asp.net tutorial,simple crud operation,insert update delete in asp.net c# with sql server,crud in asp.net,crud in c#,insert update delete and search in sql server using c#,insert in sql using asp.net c#,search data from sql using asp.net c#,insert,update,delete,view,visual studio code,crud asp.net c#,virul,crud c#,c# tutorial,retrieve

Comments are closed.