Connecting with SQL server (2008,2010,2012,2014) in Asp.net and Desktop windows Application. Method is so simple you can connect in both ways. first of all creating a form then take a Text Box and a button then go to design and double click on button.
add two classes
using System.Data;
using System.Data.SqlClient;
then write the code in button click event
SqlCommand cmd = new SqlCommand();
SqlConnection mycon = new SqlConnection();
cmd.Connection = mycon;
mycon.ConnectionString = @"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=PRO-PC\SQLEXPRESS";
mycon.Open();
cmd.CommandText = "insert into student(name)values('"+TextBox1.Text+"')";
cmd.ExecuteNonQuery();
Response.Write("record enter successfully.....");
TextBox1.text="";
mycon.Close();
-----------------------------------------------------
Create a database in server name (student) and make table (Student)
----------------------------------------------------
How to create a Connection String
create and notepade and name it whatever you want and give extension (.udl) and save it. open a new file that you have created select your server then database and click to ok again open that file with notepade and copy
--------------------------------------------
Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=PRO-PC\SQLEXPRESS
In questa pagina del sito puoi guardare il video online Data insert in SQL server in asp.net c# della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Dawood Anwar 09 agosto 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 64 volte e gli è piaciuto 0 spettatori. Buona visione!