filmov
tv
Asp.net C# Tutorial 15 - Insert data in ASP.NET C# into SQL Server Database

Показать описание
*****************************************************************************************
* Insert data in ASP.NET C# into SQL Server Database *
*****************************************************************************************
<connectionStrings>
</connectionStrings>
******************* .aspx page code **************************
<h1>Insertion Test</h1>
<asp:Label ID="Label1" runat="server" Text="First Name"></asp:Label><br />
<asp:TextBox ID="fname" runat="server"></asp:TextBox><br />
<asp:Label ID="Label2" runat="server" Text="Last Name"></asp:Label><br />
<asp:TextBox ID="lname" runat="server"></asp:TextBox><br />
<asp:Button ID="regBtn" runat="server" Text="Submit" OnClick="regBtn_Click" />
****************** assembly/library calling *********************
using System.Data.SqlClient;
using System.Configuration;
******************* .cs page code ***************************
protected void regBtn_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conString"].ConnectionString);
con.Open();
SqlCommand insertCmd = new SqlCommand(insertUser, con);
insertCmd.ExecuteNonQuery();
con.Close();
}
*******************
Note : Flow the Process shown in video.
😉Subscribe and like for more videos:
💛Don't forget to, 💘Follow, 💝Like, 💖Share 💙&, Comment
Tutorial Link :
Thanks & Regards,
Chitt Ranjan Mahto "Chirag"
_________________________________________________________________________________________
Note: All scripts used in this demo will be avilable in our website.
Link will be available in description.
* Insert data in ASP.NET C# into SQL Server Database *
*****************************************************************************************
<connectionStrings>
</connectionStrings>
******************* .aspx page code **************************
<h1>Insertion Test</h1>
<asp:Label ID="Label1" runat="server" Text="First Name"></asp:Label><br />
<asp:TextBox ID="fname" runat="server"></asp:TextBox><br />
<asp:Label ID="Label2" runat="server" Text="Last Name"></asp:Label><br />
<asp:TextBox ID="lname" runat="server"></asp:TextBox><br />
<asp:Button ID="regBtn" runat="server" Text="Submit" OnClick="regBtn_Click" />
****************** assembly/library calling *********************
using System.Data.SqlClient;
using System.Configuration;
******************* .cs page code ***************************
protected void regBtn_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conString"].ConnectionString);
con.Open();
SqlCommand insertCmd = new SqlCommand(insertUser, con);
insertCmd.ExecuteNonQuery();
con.Close();
}
*******************
Note : Flow the Process shown in video.
😉Subscribe and like for more videos:
💛Don't forget to, 💘Follow, 💝Like, 💖Share 💙&, Comment
Tutorial Link :
Thanks & Regards,
Chitt Ranjan Mahto "Chirag"
_________________________________________________________________________________________
Note: All scripts used in this demo will be avilable in our website.
Link will be available in description.