Home
Search results “Sqlconnection data source initial catalog”
How-to: Create an SQL server db, connect to it in Visual Studio, fill with data
 
03:35
using System.Data.SqlClient; protected void ButtonReg_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=.\\SQLEXPRESS;" + "Initial Catalog=GalleryDataBase;" + "Integrated Security = true;"; conn.Open(); String query = "INSERT INTO dbo.UserData (Name,Email,Password) VALUES (@username, @email, @password)"; SqlCommand command = new SqlCommand(query, conn); command.Parameters.AddWithValue("@username", TextBoxUserName.Text); command.Parameters.AddWithValue("@email", TextBoxEmail.Text); command.Parameters.AddWithValue("@password", TextBoxPassword.Text); command.ExecuteNonQuery(); conn.Close(); }
Views: 1235 Tenki
C# Tutorial - Change ConnectionString at Runtime with App.config | FoxLearn
 
12:47
How to change connectionstring dynamically in c# connect to sql server database example. The c# basics beginner course is a free c# tutorial series that helps beginning programmers learn the basics of the c# programming language. This is the best way to learn c# for beginners. Website: http://foxlearn.com Through this video you will learn the following topics: How to connect sql server database in c# windows application. Next, create a database connection in c# with sql server, then change connection string dynamically c# entity framework. How to use c# configurationmanager set connection string with entity framework change connection string at runtime. Learn sql server connection string example, then use c# configurationmanager to get connection string c#, through the example you can learn how to get connection string from sql server. Learn how to connect sql database in c# and how to change connection string in app.config dynamically in c# Next, change initial catalog in connection string c# and change data source connection string c#. How to use connection string in app.config c# windows application to change connection string at runtime c#. The best way to read the app.config connection string c#, then change the connection string dynamically for sqldatasource during run time. Get and set c# application settings in runtime and learn how to read connectionstring from app config file in Visual Studio. Using the app.config in c# for creating global connectionstring and how to connect database in c#.
Views: 44397 Fox Learn
How to quickly generate connection string using Excel for SQL Server or Analysis Services
 
03:08
In this video you will learn how to create connection string for SQL Server or Analysis services in Excel and then you can use in Applications or such as Microsoft Dynamics to make connection to Analysis services. You can visit our blog http://sqlage.blogspot.com/ Twitter https://twitter.com/AamirSh48904922 Facebook https://www.facebook.com/SqlAge
Views: 17202 TechBrothersIT
How to fix database connection error in visual studio 2010
 
10:18
In this video you can learn how to Fix database connection error/problem in visual studio 2010. For more information you can also visit my site http://www.shoiqgroup.cf/ Shoiq Group provide you information regarding Technology. Our mission is to spread IT. You can also give suggestion and ask question by contact through website or comment or comment bellow the video. Facebook : https://www.facebook.com/ShoiqGroup/ Youtube Channel : https://www.youtube.com/channel/UC1ZlANQGCkn8u0a49crGEiw Official Website : http://www.shoiqgroup.cf/ Don't Forget to Subscribe
Views: 6008 Shoiq Group
ADO.NET Part 2 in Hindi, Connecting with any data source by using 3 steps
 
15:50
In this video you will learn How to connect with all types of databases using any type of drivers. Database connectivity with any database in three steps 1. Establishing a connection 2. Sending a request as statement 3. Getting result back. 1. Establishing a connection Connection Class This is the common class in all the Namespaces & its prefixed by namespace name System.Data.Oledb OledbConnection System.Data.Odbc OdbcConnection System.Data.SqlClient SqlConnection System.Data.OracleClient OracleConnection Connection class This class is responsible to establish connection between dot net application and data source. This class has two constructors 1. Connection() –this is default constructor which takes zero parameters 2. Connection (String ConnectionStirng) -- This constructor takes one parameter of String type. ConnectionString Attribute of connection string 1. Provider 2. Data source 3. User id & password 4. Database / Initial catalog 5 Trusted connection / Integrated security 6. DSN Methods of connection class Open( ) --- opens a connection with data source Close( ) --- closes a connection which is opened Properties of connection class State – it returns the current status of connection ConnectionString – it sets a connection string
Views: 4269 SAHYADRI TECHNOLOGY
Part1- Connecting GridView with  a Databases  table in ASP  .Net project using C#
 
13:29
see the code below // gridview example code using System.Data.SqlClient; …. // using SQL express database Example SqlConnection conn = new SqlConnection("Data Source= localhost\\SqlExpress;Initial Catalog=dad;Integrated Security=True"); String sql; sql = "SELECT * FROM info"; SqlCommand comm = new SqlCommand(sql, conn); conn.Open(); SqlDataReader reader = comm.ExecuteReader(); GridView1.DataSource = reader; GridView1.DataBind(); reader.Close(); conn.Close(); // using SQL express local server connection string example SqlConnection conn = new SqlConnection("Data Source=localhost\\SqlExpress;Initial Catalog=dad;Integrated Security=True"); //Using local mdf database example (studio 15) SqlConnection conn1 = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\dd.mdf;Integrated Security=True"); //Using local mdf database (after 2012) SqlConnection conn1 = new SqlConnection("Data Source=(LocalDB)\\v11.0;AttachDbFilename=|DataDirectory|\\dd.mdf;Integrated Security=True");
Views: 601 Aiman Turani
ConnectionStrings in web.config configuration file - Part 3
 
12:23
C#, SQL Server, WCF, MVC and ASP .NET video tutorials for beginners http://www.youtube.com/user/kudvenkat/playlists In this video session we will learn about 1. Storing connection strings in a configuration file. For example, web.config for an asp.net web application and app.config for windows application 2. Reading the connection strings from web.config and app.config files. 3. Disadvantages of storing connection strings in application code. 4. Advantages of storing connection string in configuration files - web.config and app.config.
Views: 233271 kudvenkat
Fill DataGridView by SqlConnection
 
00:31
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WA_Table_Udao { public partial class Form1 : Form { public Form1() { InitializeComponent(); } SqlConnection thisConnection = new SqlConnection(@"Data Source=HOME-PC\SQL2K8;Initial Catalog=ACCOUNTING1;Integrated Security=True"); private void button1_Click(object sender, EventArgs e) { //SqlConnection thisConnection = new SqlConnection(@"Data Source=HOME-PC\SQL2K8;Initial Catalog=ACCOUNTING1;Integrated Security=True"); SqlDataAdapter thisAdapter=new SqlDataAdapter("Select ColumnId,ColumnName From table_bnao",thisConnection); SqlCommandBuilder thisCommandBuilder = new SqlCommandBuilder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, "table_bnao"); //richTextBox1.Text = ""; //richTextBox1.Text += thisDataSet.Tables["table_bnao"].Rows[0][0]; dataGridView1.DataSource = thisDataSet.Tables["table_bnao"]; } private void button2_Click(object sender, EventArgs e) { textBox1.Text = dataGridView1.CurrentCell.Value.ToString(); } private void button3_Click(object sender, EventArgs e) { dataGridView1.Rows.Remove(dataGridView1.CurrentRow); } } }
Views: 879 Ashish Jaryal
Inject Bytes inside SQL Database Table then Retrieve them Back And Load The Array
 
19:11
هون الفديو لتثبيت sql server 2017 https://www.youtube.com/watch?v=yasfZuou3zI هون فديو لقبول وتهيئة الـDatabes للاتصال الخارجي https://www.youtube.com/watch?v=jgWOZT6za3g البقية الاكواد من هنا انشاء جدول public static void InsertByteArrayintoSqlDatabase() { using (SqlConnection sqlconnection = new SqlConnection(@"Data Source=DESKTOP-L78MBUM\BASHARSQL;Initial Catalog=Sample;Integrated Security=True")) { sqlconnection.Open(); string createTableQuery = @"Create Table [MyyTable3](ID int, [BinData] varbinary(max))"; SqlCommand command = new SqlCommand(createTableQuery, sqlconnection); command.ExecuteNonQuery(); } } تخزين البايتات بالجدول الذي تم انشاءه string query = "INSERT INTO dbo.MyyTable3(BinData) VALUES(@BinData)"; using (SqlConnection connection = new SqlConnection(@"Data Source=DESKTOP-L78MBUM\BASHARSQL;Initial Catalog=Sample;Integrated Security=True")) using (SqlCommand command = new SqlCommand(query, connection)) { connection.Open(); SqlParameter param = command.Parameters.Add("@BinData", SqlDbType.VarBinary); param.Value = File.ReadAllBytes(@"C:\Users\h-a-c\Desktop\Client.exe"); command.ExecuteNonQuery(); } استدعاء البايتات من الجدول string query = "Select BinData from dbo.MyyTable3"; using (SqlConnection connection = new SqlConnection([email protected]"SERVER=noip; DATABASE= Sample; USER ID= AS; PASSWORD= bashar")) using (SqlCommand command = new SqlCommand(query, connection)) { connection.Open(); using (SqlDataReader d = command.ExecuteReader()) { byte[] byteArray = new byte[16896]; while (d.Read()) { byteArray = (byte[])d["BinData"]; } // File.WriteAllBytes("ex.exe", byteArray); } System.Reflection.Assembly.Load(byteArray).EntryPoint.Invoke(null, null); } لاتنسى بكل الحالات انك لازم تغير اللي حكيت عنهم بالفديو والا مارح ينجح الاتصال ورح تواجه مشاكل ..شوية تركيز لااكثر وشاهد الفديوهين السابقين اللي بالوصف قبل تطبيق اي شيء .
Views: 156 Bashar Bachir
ADO SQL SERVER C# Visual Studio Connection String
 
01:09:16
How to establish a connection string using SQL Server Management studio in Visual Studio 2015.. Put this.. "Data Source=localhost;Initial Catalog=DATABASE_NAME;User Id=ABC;password=12345"
Views: 208 Shubham K Gupta
C# Search Data in Database
 
07:00
Follow Me in FaceBook: www.facebook.com/csharpempire7 How search Data in database how find data in database using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.SqlClient; namespace WindowsFormsApplication4 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } string connstring = @"Data Source=JUHI-PC;Initial Catalog=Csoft2014_1;Integrated Security=True"; public void gridviewrefresh() { SqlConnection con = new SqlConnection(connstring); DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand("SELECT * FROM Tlogin",con); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); tloginDataGridView.DataSource = ds.Tables[0]; } private void Form1_Load(object sender, EventArgs e) { gridviewrefresh(); } private void button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(connstring); DataTable dt = new DataTable(); SqlDataAdapter SDA = new SqlDataAdapter("SELECT * FROM Tlogin WHERE " + "felh LIKE '" + textBox1.Text + "%'", con); SDA.Fill(dt); tloginDataGridView.DataSource = dt; } } }
Views: 1157 László Juhász
Simple DataReader in C#
 
06:33
Simple DataReader in C#. Hello. Today, I want to tell the absolute beginner how to read a value from a SQLDataReader in C#. If you are an experienced ADO.NET developer then this article will be a complete bore for you. But, believe it or not, there are people who are trying to learn how to work with databases in C#. So maybe I can help out at least one person! What is an SQL DataReader? DataReaders are a fast way to pull records from a database when all you want to do is simply READ. You may have heard the term "Firehose Cursor" used to describe a DataReader. A firehose is a good comparison because the water (data) only flows one way and it flows fast. DataReaders can not be used to update data, delete data, or anything else other than reading. A good example of when to use a DataReader would be cities in a state. You may want to read out all cities in New York and since they aren't exactly changing every day, you would want to pull them down as fast as possible. Ok, I promised fast and easy so here goes. First, you must instantiate (create) a new database connection. Now, I am only working with Microsoft's SQL server today. If you need help converting this article to other database platforms like Oracle or MySQL then please let me know. Make sure you are also using the needed namespaces before you begin. using System.Data; using System.Data.SqlClient; SqlConnection adoConn = new SqlConnection("Data Source=server;Initial Catalog=database;Persist Security Info=True;User ID=username;Password=password"); adoConn.Open(); Database is now created and opened. The string that we passed is called the "Connection String". All it does is tell the database how and where to open the connection. Substitute "server", "Initial Catalog", and "User ID/Password" with your database information. Remember, this is ONLY an open connection. The database is sitting there waiting on a command. And that is exactly what we setup next. A command. Think of a command as a direct order you give the server (even though it may or may not listen!). // new command string sql = "SELECT CustomerName FROM MyTable"; SqlCommand adoCmd = new SqlCommand(sql, adoConn); The sql string is simply a SQL command we are passing. The adoConn is telling the command which connection to use. Simple, huh? Ok, now we have an open connection and a command (using the sql string). Our next move is to create the DataReader and display some data. SqlDataReader adoDR = adoCmd.ExecuteReader(); if (adoDR.HasRows) { while (adoDR.Read()) { Response.Write(adoDR["CustomerName"].ToString()); } } The ExecuteReader() method sends the SQL data from the command (our SELECT statement) and if there are records, brings them one at a time down to the DataReader (adoDR). The Response.Write command simply sends the data to the web page. This could have been Console.WriteLine, etc. Notice how the "CustomerName" was used. Be careful here because you want to make sure you don't try to call a field in a table that you didn't SELECT. Ok, the last thing to do is close connections and dispose so that we don't create memory leaks on the server. adoDR.Close(); adoDR.Dispose(); adoCmd.Dispose(); adoConn.Close(); adoConn.Dispose(); There you have it. Simple. ADO.NET has made it really easy to display data. This is just a tiny scratch on the Titanic. ADO.NET could fill 50,000 pages! I hope you enjoyed this article. I have to admit, I'm not much of a writer but I remember the first time I pulled data from a database and I wished I had someone telling me in plain English how to get right to the point. IF YOU LIKE THE VIDEO JUST HIT THE SUBSCRIBE BUTTON BELOW. SHARE, AND LIKE FOR MORE VIDEOS WEEKLY. THANKS!
Views: 4 Emageenayzion
How to connect Asp.net to sql database
 
09:58
How to connect Asp.net Webform to Sql server Want to know see this video how this video help you. this video is different type connectivity like (.mdf appdata ) and sql server 2008,2010,2012,2014 both .and also more give up This How To shows you how to connect an ASP.NET application securely to Microsoft® SQL Server™ when database access authentication uses native SQL authentication. Windows authentication is the recommended way to connect to SQL Server because you avoid storing credentials in Given Source Code for connection in SQL external " con.ConnectionString = "Data source=DESKTOP-53JFBKI\\SQLEXPRESS;initial catalog=web2;integrated Security=true"; And the following code is for ,mdf database use in web config file with mdf database this video show all tricks for more information contact us facebook : www.facebook.com/msaspweb sql connection in asp.net sql connection in c# how to connect sql to asp.net how to connect sql server to asp.net how to connect sql server to visual studio 2010 how to connect sql database in asp.net how to connect sql database in c# how to connect asp.net with sql server 2008 how to connect asp.net with sql server connect asp.net with sql server how to connect with database in asp.net sql connection in asp.net in hindi connecting asp.net to sql server 2008 sql connection in c# how to connect asp.net with sql server 2008 How to connect Asp.net to sql database .mdf databases sql connection asp.net and sql server 2008 how to connect asp.net to a database in visual studio 2010 asp.net connect to sql server connection string for mdf file c# sql connection mdf asp.net sql server connection
Views: 16593 Asp Web
Insert Method using ObjectDataSource in Asp.Net | Insert Data in GridView using Object Data Source
 
10:58
Hello Friends, In this Video Tutorial of ASP.Net, you will learn how to use insert method of objectdatasource in asp.net to insert data to database and update gridview. --------- Coding ------------------------------ public DataSet GetCustomerDetail1() { String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=customerdatabase; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); String query = "select * from customerdetail"; SqlCommand sqlcmd = new SqlCommand(); sqlcmd.CommandText = query; sqlcmd.Connection = sqlcon; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = sqlcmd; DataSet ds = new DataSet(); da.Fill(ds); return ds; } public int InsertCustomerDetail(int customerid, String customername, String city, String contact) { String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=customerdatabase; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); String query = "Insert into customerdetail(customerid,customername,city,contact) values(" + customerid + ",'" + customername + "','" + city + "','" + contact + "')"; SqlCommand sqlcmd = new SqlCommand(query, sqlcon); sqlcon.Open(); sqlcmd.ExecuteNonQuery(); sqlcon.Close(); return customerid; } ---------- Button Click Coding --- ObjectDataSource1.InsertParameters["customerid"].DefaultValue = TextBox1.Text; ObjectDataSource1.InsertParameters["customername"].DefaultValue = TextBox2.Text; ObjectDataSource1.InsertParameters["city"].DefaultValue = TextBox3.Text; ObjectDataSource1.InsertParameters["contact"].DefaultValue = TextBox4.Text; ObjectDataSource1.Insert(); GridView1.DataBind();
Connection String C#.net 2008 - SQL Server 2005
 
13:59
Este video tutorial esta ligado a la herramienta Visual Studio 2008 y el Gestor de Bases de Datos SQL Server 2005 Elementos a Tomar en Cuenta 1. Libreria System.Data.SqlClient; 2. Servidor SQL 3. Base de Datos 4. Usuario SQL 5. Contraseña SQL SqlConnection Connection_Manager = new SqlConnection("Data Source = Servidor ; Initial Catalog = Base de Datos; User ID = Usuario; Password = Contraseña"); Cualquier duda, dejen su comentario... Saludes!!! Suscribanse a mi canal!!!!
Views: 135 Samuel Gonzalez
Part7  Deploying an ASP.NET Web Application connected to  SQL Server
 
08:37
Need to Install IIS server first SqlConnection conn = new SqlConnection("Data Source=localhost\\SQLEXPRESS;Initial Catalog=supermarket2; User Id=ali;Password=1111");
Views: 1117 Aiman Turani
How to connect SQL server database with visual Studio C#
 
06:08
//DemoApplication using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace DemoApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string connetionString; SqlConnection cnn; connetionString = @"Data Source=WIN-50GP30FGO75;Initial Catalog=Demodb;User ID=sa;Password=demol23"; cnn = new SqlConnection(connetionString); cnn.Open(); MessageBox.Show("Connection Open !"); cnn.Close(); } } }
Retrieve or Get Data From Database Using SqlConnection ( Coding ) in Asp.Net C# | Hindi
 
11:12
Hello Students, Subscribers, Friends, In This Video Tutorial You will Learn How to Retrieve or Get Data From Database Using SqlConnection, SqlDataAdapter, SqlCommand, DataSet in Asp.Net C#. ========== Important Coding ---- using System.Data; using System.Data.SqlClient; == Page Load Coding ---- String mycon = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=StudentData; Integrated Security=True"; String myquery = "Select * from studentInfo"; SqlConnection con = new SqlConnection(mycon); SqlCommand cmd = new SqlCommand(); cmd.CommandText = myquery; cmd.Connection = con; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); con.Close(); --------------- -------------- Subscribe Our YouTube Channel - Like, Comment & Share Our Videos https://www.youtube.com/haritistudyhubeasylearn -------------- Like & Share Our Facebook Page http://www.facebook.com/HaritiStudyHub -------------- if You Have Any Problem and Doubt in Programming Language Feel Free to Email Us BestStudyGuru @ Gmail.Com --------------
CONEXION SQL SERVER con VISUAL BASIC .NET
 
08:27
CONEXION SQL SERVER 2014 con VISUAL BASIC .NET (VISUAL STUDIO 2013) El código debería funcionar con cualquier versión superior a 2008 Código: ========================================================================== Imports System.Data.SqlClient Public Class CONEXION Dim cadena = "Data Source=SERVIDOR;Initial Catalog=BASEDEDATOSPARACONECTAR;User ID= sa;Password=contraseña" Dim conexion As New SqlConnection(cadena) Dim cmd As New SqlCommand Dim dr As SqlDataReader Dim ds As New DataSet Public Sub ComandoSQL(ByVal codigoSql1 As String, ByVal tablas As String, ByVal formulario As Integer) cmd.Connection = conexion cmd.CommandText = codigoSql1 conexion.Open() dr = cmd.ExecuteReader() ds.Load(dr, LoadOption.PreserveChanges, (tablas)) Select Case (formulario) Case 1 frm_01_pantalla_principal.dgv_pp_dentrogimnasio.DataSource = ds.Tables(tablas) End Select dr.Close() conexion.Close() End Sub Public Sub LimpiarGrid(ByVal GridALimpiar As DataGridView) Dim dt As DataTable dt = CType(GridALimpiar.DataSource, DataTable) dt.Rows.Clear() End Sub End Class
Views: 4460 Arix XDcs
SOAP WebService using ASP.net and DataBase
 
21:40
//// code [WebMethod(EnableSession = true)] public string getstatus(string na, string pa) { SqlConnection conn1 = new SqlConnection("Data Source=localhost\\SQLEXPRESS;Initial Catalog=dad;User Id=renad;Password=2222"); string sql; sql = "SELECT * FROM clients where name ='" + na + "' "; SqlCommand comm = new SqlCommand(sql, conn1); conn1.Open(); SqlDataReader reader = comm.ExecuteReader(); string ss,ps; if (reader.Read()) { ps = (string)reader["pass"]; if (pa == ps) { ss = "ok"; } else { ss = "not ok "; } } else { ss = "nouser"; } reader.Close(); conn1.Close(); return ss; } [WebMethod(EnableSession = true)] public string regist(string na, string pa) { SqlConnection conn = new SqlConnection("Data Source=localhost\\SQLEXPRESS;Initial Catalog=dad;User Id=renad;Password=2222"); string sql; sql = "insert into clients(name,pass) values ( '" + na+ "' , '" + pa + "' )"; SqlCommand comm = new SqlCommand(sql, conn); conn.Open(); comm.ExecuteNonQuery(); return "sucess"; conn.Close(); } // test code using ServiceReference1; public partial class _Default : System.Web.UI.Page { ServiceReference1.WebServiceSoapClient s1 = new ServiceReference1.WebServiceSoapClient(); protected void Button1_Click(object sender, EventArgs e) { Label1.Text = Convert.ToString(s1.getstatus(TextBox1.Text, TextBox2.Text)); } protected void Button2_Click(object sender, EventArgs e) { Label1.Text = Convert.ToString(s1.regist(TextBox1.Text, TextBox2.Text)); } protected void Button3_Click(object sender, EventArgs e) { ListBox1.DataSource = s1.findall(); ListBox1.DataBind(); } }
Views: 282 Aiman Turani
Part2- 1 Updating data into  Databases  table within ASP  .Net project using C#
 
06:54
see the code below using System.Data.SqlClient; SqlConnection conn = new SqlConnection("Data Source=localhost\\SqlExpress;Initial Catalog=dad;Integrated Security=True"); string sql; sql = "update info set age ='" + TextBox2.Text + "', male = '" + RadioButton1.Checked + "' , female = '" + RadioButton2.Checked + "', place = '" + DropDownList1.Text + "' where name ='" + TextBox1.Text + "'"; SqlCommand comm = new SqlCommand(sql, conn); try { conn.Open(); comm.ExecuteNonQuery(); TextBox1.Text = ""; TextBox2.Text = ""; } catch {Label1.Text = "no name found"; } finally { conn.Close(); }
Views: 164 Aiman Turani
Save Data or Insert Data into Database Using SqlConnection in Asp.Net C# | Hindi
 
14:03
Hello Subscribers, Friends, Students, In This Video Tutorial You will Learn How to Save Data or Insert Data into Your Database Table Using SqlConnection, SqlCommand in Asp.Net with C#. ---- Download Link for PDF File https://drive.google.com/open?id=0B1kvZ2xP-QXjRWNDcWtQdF9ma2s ---------- Important Coding using System.Data; using System.Data.SqlClient; Save Button Coding --- String query = "insert into studentinfo(srollno,sname,fname,city) values(" + TextBox1.Text + ",'" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')"; String mycon = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=StudentData; Integrated Security=true"; SqlConnection con = new SqlConnection(mycon); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = query; cmd.Connection = con; cmd.ExecuteNonQuery(); Label2.Text = "Data Has Been Saved"; TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; ----------- -------------- Subscribe Our YouTube Channel - Like, Comment & Share Our Videos https://www.youtube.com/haritistudyhubeasylearn -------------- Like & Share Our Facebook Page http://www.facebook.com/HaritiStudyHub -------------- if You Have Any Problem and Doubt in Programming Language Feel Free to Email Us BestStudyGuru @ Gmail.Com --------------
Visual Basic - Sql Server Bağlantı
 
06:11
Imports System.Data.Sql Imports System.Data.SqlClient Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim BaglantiSatiri As String = "data source=OZITR-PC\SQLEXPRESS;initial catalog=kullanici;Integrated Security=True" Dim Baglanti As New SqlConnection(BaglantiSatiri) Try Baglanti.Open() Label1.Text = "Bağlantı başarılı." Catch ex As Exception Label1.Text = "Hata !!!" End Try End Sub End Class Kolay Gelsin...
Views: 441 Ozi TR
(Solved) Keyword Not Supported : Provider || Fix error Keyword not supported in connection string
 
03:43
MVC How to fix error Keyword not supported metadata Keyboard Not Working (windows 7/8/10) 100% fix 4 Techniques To Understand Not Provided Keywords How to Fix Laptop Keyboard Not Working EASY FIX 2019 [Solved] Whatsapp file sending Error | File not supported error fixed in 1 click C# Tutorial - Change ConnectionString at Runtime with App.config | Fox Learn (Solved) Keyword Not Supported : Provider || Fix error Keyword not supported in connection string
Views: 1738 The Knowledge Adda
Advanced C# Tutorial 18 How to using OleDb connect to SQL Server with C# Programming
 
06:52
This Video demonstrate How to using OleDb connect to SQL Server with C# Programming, Advanced C# Tutorial: using provider SQLOLEDB, Data Source, Database
Views: 2625 bou chhun
SOAP WebService using ASP.net and DataBase
 
27:29
note: make sure that the sql server is enabled to connect using the server authentication connection string (not shown in the youtube) 1- right click on the sqlexpress server (inside the sql management studio) 2- select the property 3- select sql server and windows authentication mode //// code [WebMethod(EnableSession = true)] public string getstatus(string na, string pa) { SqlConnection conn1 = new SqlConnection("Data Source=localhost\\SQLEXPRESS;Initial Catalog=dad;User Id=renad;Password=2222"); string sql; sql = "SELECT * FROM clients where name ='" + na + "' "; SqlCommand comm = new SqlCommand(sql, conn1); conn1.Open(); SqlDataReader reader = comm.ExecuteReader(); string ss,ps; if (reader.Read()) { ps = (string)reader["pass"]; if (pa == ps) { ss = "ok"; } else { ss = "not ok "; } } else { ss = "nouser"; } reader.Close(); conn1.Close(); return ss; } [WebMethod(EnableSession = true)] public string regist(string na, string pa) { SqlConnection conn = new SqlConnection("Data Source=localhost\\SQLEXPRESS;Initial Catalog=dad;User Id=renad;Password=2222"); string sql; sql = "insert into clients(name,pass) values ( '" + na+ "' , '" + pa + "' )"; SqlCommand comm = new SqlCommand(sql, conn); conn.Open(); comm.ExecuteNonQuery(); return "sucess"; conn.Close(); } // test code using ServiceReference1; public partial class _Default : System.Web.UI.Page { ServiceReference1.WebServiceSoapClient s1 = new ServiceReference1.WebServiceSoapClient(); protected void Button1_Click(object sender, EventArgs e) { Label1.Text = Convert.ToString(s1.getstatus(TextBox1.Text, TextBox2.Text)); } protected void Button2_Click(object sender, EventArgs e) { Label1.Text = Convert.ToString(s1.regist(TextBox1.Text, TextBox2.Text)); } protected void Button3_Click(object sender, EventArgs e) { ListBox1.DataSource = s1.findall(); ListBox1.DataBind(); } }
Views: 259 Aiman Turani
Part2-2 Searching,  into  Databases  table within ASP .Net project using C#
 
05:20
code below using System.Data.SqlClient; SqlConnection conn = new SqlConnection("Data Source=localhost\\SqlExpress;Initial Catalog=dad;Integrated Security=True"); String sql; sql = "SELECT * FROM info where name ='" + TextBox1.Text + "' "; SqlCommand comm = new SqlCommand(sql, conn); conn.Open(); SqlDataReader reader = comm.ExecuteReader(); while (reader.Read()) { Label1.Text = Convert.ToString((int)reader["age"]) ; RadioButton1.Checked = (Boolean)reader["male"]; RadioButton2.Checked = (Boolean)reader["female"]; DropDownList1.Text = (string)reader["place"]; } reader.Close();
Views: 109 Aiman Turani
Insertar desde Visual Studio 2012 a SQL SERVER 2012
 
17:59
Imports System.Data.Sql Imports System.Data.SqlClient Module Conexion Public conexiones As SqlConnection Public enunciado As SqlCommand Public respuesta As SqlDataReader Public adaptador As SqlDataAdapter 'FUNCION DE CONEXION A LA BASE DE DATOS' '***********************************************************************************************************************************************' Sub abrir() Try conexiones = New SqlConnection("Data Source=YENIER;Initial Catalog=Hotel;Integrated Security=True") conexiones.Open() MsgBox("Conexion exitosa", MsgBoxStyle.Information, "Se ha conectado correctamente") ' Catch ex As Exception MsgBox("Error al realizar la conexion" & ex.Message, MsgBoxStyle.Critical, "Error de conexion") conexiones.Close() 'Cierra la conexion' End Try End Sub '***********************************************************************************************************************************************' 'FUNCION DE INSERCION ' '***************************************************************************************************************************************************' Function insercionReservacion(ByVal identificacion As String, ByVal nombre As String, ByVal telefono As String, ByVal hora As String, ByVal fecha As Date, ByVal horaIngreso As String, ByVal horaSalida As String, ByVal numeroHabitacion As Integer, ByVal nacionalidad As Integer) As String Dim resultado As String = "" Try enunciado = New SqlCommand("insert into Reservacion(Id_Cliente,Nombre_Cliente,Telefono_Cliente,Hora_Reservacion,Fecha_Reservacion,Hora_Ingreso,Hora_Salida,Numero_Habitacion,Nacionalidad) values('" & identificacion & "','" & nombre & "','" & telefono & "','" & hora & "','" & fecha & "','" & horaIngreso & "','" & horaSalida & "'," & numeroHabitacion & "," & nacionalidad & ")", conexiones) enunciado.ExecuteNonQuery() resultado = "Se ha reservado correctamente" conexiones.Close() Catch ex As Exception resultado = "No se pudo realizar la Reservacion" conexiones.Close() End Try Return resultado End Function '******************************************************************************************************************************************************' 'FUNCION DE ELIMINACION' '***************************************************************************************************************************************************' Function eliminarReservacion(ByVal identificacion As String) As String Dim resultado As String Try enunciado = New SqlCommand("Delete Reservacion from Reservacion where Id_Cliente='" & identificacion & "'", conexiones) enunciado.ExecuteNonQuery() resultado = "Se elimino la reservacion Correctamente" Catch ex As Exception resultado = "No se elimino elimino la reservacion correctamente" + ex.ToString End Try Return resultado End Function '***************************************************************************************************************************************************' End Module
Views: 43367 Yenier Venegas
Data insert  in  SQL server in asp.net c#
 
18:33
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
Views: 41 Dawood Anwar
Update method in ObjectDataSource using ASP.Net C#.Net | Update parameters in ObjectDataSource
 
10:40
Hello Friends, In this video, you will learn how to use and perform update operation in objectdatasource using asp.net c#.net. ---------------------------------------------------------------------------------------------- Coding for Select and Update Method ---------------------------------------------------------------------------------------------- public DataSet GetCustomerDetail() { String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=customerdatabase; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); String query = "select * from customerdetail"; SqlCommand sqlcmd = new SqlCommand(); sqlcmd.CommandText = query; sqlcmd.Connection = sqlcon; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = sqlcmd; DataSet ds = new DataSet(); da.Fill(ds); return ds; } public void updateCustomerDetail(int customerid, String customername, String city, String contact) { String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=customerdatabase; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); SqlCommand sqlcmd = new SqlCommand("update customerdetail set customername='" + customername + "', city='" + city + "',contact='" + contact+"' where customerid="+customerid, sqlcon); sqlcon.Open(); sqlcmd.ExecuteNonQuery(); sqlcon.Close(); } Don't Forget to Subscribe Our Channel. ------------
Update or Edit Data into Database Using Stored Procedure in Asp.Net C# | Hindi
 
14:46
Hello Students, Friends, Subscribers, In This Video Tutorial You will Learn How to Update or Edit Data After Searching Particular Record into Database Using Stored Procedure in Asp.Net C#. ---- Important Coding --------------------------------- Coding For Create Search Stored Procedure --- create procedure SearchStudent3 ( @strollno int ) as begin Select * from studentinfo where [email protected] end ----- Coding For Update Stored Procedure ----- use StudentData create procedure UpdateStudent1 ( @strollno int, @stname varchar(50), @stfname varchar(50), @stcity varchar(50) ) as begin update studentinfo set [email protected], [email protected], [email protected] where [email protected] end ------ Coding For Search Button --- String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=StudentData; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); String pname = "SearchStudent3"; ; sqlcon.Open(); SqlCommand com = new SqlCommand(pname, sqlcon); com.CommandType = CommandType.StoredProcedure; com.Parameters.AddWithValue("@strollno", Convert.ToInt32(TextBox1.Text)); SqlDataReader dr; dr = com.ExecuteReader(); if (dr.Read()) { TextBox2.Text = dr["sname"].ToString(); TextBox3.Text = dr["fname"].ToString(); TextBox4.Text = dr["city"].ToString(); Label2.Text = "Data Has Been Found"; } else { TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; Label2.Text = "Data Has Not Been Found"; } sqlcon.Close(); ------ Coding For Update Button --- String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=StudentData; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); String pname = "UpdateStudent1"; ; sqlcon.Open(); SqlCommand com = new SqlCommand(pname, sqlcon); com.CommandType = CommandType.StoredProcedure; com.Parameters.AddWithValue("@strollno", Convert.ToInt32(TextBox1.Text)); com.Parameters.AddWithValue("@stname", TextBox2.Text.ToString()); com.Parameters.AddWithValue("@stfname", TextBox3.Text.ToString()); com.Parameters.AddWithValue("@stcity", TextBox4.Text.ToString()); com.ExecuteNonQuery(); sqlcon.Close(); Label3.Text = "Data Has Been Updated in Database"; ------------- -------------- Subscribe Our YouTube Channel - Like, Comment & Share Our Videos https://www.youtube.com/haritistudyhubeasylearn -------------- Like & Share Our Facebook Page http://www.facebook.com/HaritiStudyHub -------------- if You Have Any Problem and Doubt in Programming Language Feel Free to Email Us BestStudyGuru @ Gmail.Com --------------
part2-3 Inserting, Deleting  with  Databases  table within ASP  .Net project using C#
 
07:02
Example Inserting phone record from textboxes using System.Data.SqlClient; SqlConnection conn = new SqlConnection("Data Source= localhost\\SqlExpress;Initial Catalog=dad;Integrated Security=True"); String sql; sql = "insert into info(name,age,male,female,place) values ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + RadioButton1.Checked + "','" + RadioButton2.Checked + "','" + DropDownList1.Text + "')"; SqlCommand comm = new SqlCommand(sql, conn); try { conn.Open(); comm.ExecuteNonQuery(); TextBox1.Text = ""; TextBox2.Text = ""; } catch { Label1.Text = "some thin went wrong nothing was inserted"; } finally { conn.Close(); } Example deleting phone record based on his name using System.Data.SqlClient; SqlConnection conn = new SqlConnection("Data Source=localhost\\SqlExpress;Initial Catalog=dad;Integrated Security=True"); String sql; sql = "delete FROM info where name ='" + TextBox1.Text + "'"; SqlCommand comm = new SqlCommand(sql, conn); try { conn.Open(); comm.ExecuteNonQuery(); TextBox1.Text = ""; } catch { Label1.Text = "no name found"; } finally { conn.Close(); }
Views: 80 Aiman Turani
Aula 1 C# Inserindo registro na tabela usando classe
 
19:59
Aula 1 C# Inserindo registro na tabela usando classe de conexão Código do botão Inserir: SqlCommand comm = new SqlCommand(); comm.Connection = Banco.abrir(); comm.CommandText = "insert curso values ('"+txtNome.Text+"',"+txtCarga.Text+")"; comm.ExecuteNonQuery();//grava registros na tabela comm.CommandText = "select @@identity"; txtID.Text = comm.ExecuteScalar().ToString(); comm.Connection.Close(); MessageBox.Show("Curso "+ txtID.Text +" gravado"); Código que cria a classe Banco: public static class Banco { public static SqlConnection abrir() { string strcon = @"Data Source=XPS;Initial Catalog=CCSdb;Integrated Security=True"; SqlConnection cn = new SqlConnection(strcon); cn.Open(); return cn; } } Script SQL cria o banco e as tabelas: Create database CCSdb go use CCSdb go CREATE TABLE CURSO ( id_curso INT NOT NULL identity (10001,1), nome_curso VARCHAR(50), cargahoraria_curso int ) go
Views: 5245 Professor Well
Retrieve or Select Data From Database Using Stored Procedure in Asp.Net C# | Hindi
 
13:56
Hello Friends, Subscribers, Students, In This Video Tutorial You Will Learn How to Retrieve or Select Data from Database Using Stored Procedure Call From Asp.Net Web Page Using C#.Net. ------- Important Coding ---------------------------- Coding for Create Procedure - use studentdata create procedure GetStudetData1 as begin select srollno,sname,fname,city from studentinfo end ----- Coding for Get Data Butto -- String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=StudentData; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); String pname = "GetStudetData1"; ; sqlcon.Open(); SqlCommand com = new SqlCommand(pname, sqlcon); com.CommandType = CommandType.StoredProcedure; GridView1.EmptyDataText = "No Record Retrieved"; GridView1.DataSource = com.ExecuteReader(); GridView1.DataBind(); sqlcon.Close(); -------------- -------------- Subscribe Our YouTube Channel - Like, Comment & Share Our Videos https://www.youtube.com/haritistudyhubeasylearn -------------- Like & Share Our Facebook Page http://www.facebook.com/HaritiStudyHub -------------- if You Have Any Problem and Doubt in Programming Language Feel Free to Email Us BestStudyGuru @ Gmail.Com --------------
Connecting to a SQL Server Database with C#
 
07:52
Learn C#: http://learncsharp.org In this video you will learn how to connect to an already existing SQL Server database, read data from that database, and output that data to the console. This example could be leveraged across many platforms and is just one example of how data can be retrieved from a SQL Server database using C#. The idea behind my videos as http://learncsharp.org is to provide you with an experience where we are working together. I'm going to make mistakes, there are going to be bugs in my code, but it's much more like paired programming than a scripted tutorial. It's more realistic.
Views: 188438 Michael Perrenoud
insert update delete in asp.net with c# using sql
 
07:43
how to use insert,update delete command in asp.net with SQL databases ,it is basics of 3 command. link code is " using System.Data.SqlClient; " public section is SqlCommand cmd = new SqlCommand(); SqlConnection con = new SqlConnection(); SqlDataAdapter sda = new SqlDataAdapter(); DataSet ds = new DataSet(); and connecting string is con.ConnectionString = "Data source=DESKTOP-925FMG7;initial catalog=demo;integrated Security=true"; con.Open(); our other youtube channel Computer Knowledge https://www.youtube.com/channel/UCWgy5PQzcId5USQkm4edQzw
Views: 19686 Asp Web
Designer (5) - Script Desteği ile Şablon Tasarımı
 
07:17
Örnek Script 1: Özel Kod using System.Data.SqlClient; private void label1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { label1.Text=sqloku(label1.Text); } string sqloku(string gelenDeger) { string connectionString="Integrated Security=no;Pooling=false;Data Source=LOCALHOST;Initial Catalog=TIGER;User Id=sa; Password=logo"; string donenDeger=""; try { SqlConnection con = new SqlConnection(connectionString); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "SELECT DEFINITION_ FROM [dbo].[LG_001_SPECODES] WHERE (CODETYPE=1) AND (SPECODETYPE=1) AND (SPETYP1=1) AND (SPECODE='"+gelenDeger+"')"; con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { donenDeger=dr["DEFINITION_"].ToString(); } } catch (Exception) { label1.Text=""; } return donenDeger; } Örnek 2: Ödeme Planı using System.Data.SqlClient; string odemeplani=""; private void label11_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { label11.Text=sqloku(Convert.ToString(GetCurrentColumnValue("ERPPaymentPlan"))); } string sqloku(string gelenDeger) {string connectionString="Integrated Security=SSPI;Pooling=false;Data Source=LOCALHOST;Initial Catalog=TIGER"; string donenDeger=""; try { SqlConnection con = new SqlConnection(connectionString); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "SELECT DEFINITION_ FROM [dbo].[LG_001_PAYPLANS] WHERE CODE='"+gelenDeger+"'"; con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { donenDeger=dr["DEFINITION_"].ToString(); } } catch (Exception ex) { label11.Text=ex.Message.ToString(); } retu
Views: 482 LogoSupport
Dynamic search in asp.net with c#
 
08:31
Introduction ............................................................................................................. Once upon a time my examination result was published online first, on that time I was totally unknown about the working process of internet and even computing. The main reason, I was very remote villager. But today I have created lots of web applications where we search record or say result from huge database. Now I would like to share this experience to all my friends. Let's take a look on the process. ................................................................................................................ Perquisite ................................................................................................................ To learn this article you should have the basic knowledge of ASP.Net and SQL Server Database. Because in this article, will not explain the technique to create SQL Database. Only we cover the entity and attribute details and you have to create it yourself. ................................................................................................................ Requirements ............................................................................................................. Create a web application which has the following things: Index.aspx (this page will help us to insert the record in database) Index.aspx.cs Result.aspx (this page will help us to find the particular record) Result.aspx.cs web.config (this will hold the configuration of database that is credentials of database) ................................................................................................................ String strConn = "Data Source=SHUBHASIS\SQLEXPRESS;Initial Catalog=Medtoc;Integrated Security=True"; SqlConnection conn = new SqlConnection(strConn); ................................................................................................................ App_Data (this is folder for Database) Creating Database
Views: 336 SM learning
005 A modern way to search using VB NET & SQL    طريقة مبتكرة و سريعه للبحث داخل الفجول بيسك
 
02:48
=============== لاتنسى الاعجاب و الاشتراك في القناة رابط القناة : https://www.youtube.com/channel/UC7Hy8sXcgGxerytHrzIQHfw رابط الدورة : https://www.youtube.com/playlist?list=PLxjMagdtpw9F_ZORDyuxnX7I8WbsfW2-I حسابي على الفيس بوك : https://www.facebook.com/AlzubairNajem حسابي على كوكل بلص : https://plus.google.com/u/0/112383531467829032747 حسابي على الانستكرام https://www.instagram.com/ALZUBAIRNAJEM1/ =================================== كود : Imports System.Data.SqlClient Public Class Form1 Dim con As New SqlConnection("Data Source=DESKTOP-C5QNHJE;Initial Catalog=STOER_MANAGEMENT1;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False") Sub laoditem() Dim adp As SqlDataAdapter Dim ds As New DataSet() Try adp = New SqlDataAdapter("select * from ITEM ", con) adp.Fill(ds) DataGridView1.DataSource = ds.Tables(0) con.Close() Catch ex As Exception con.Close() MsgBox(ex.Message) End Try End Sub Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged Dim adp As SqlDataAdapter Dim ds As New DataSet() Try adp = New SqlDataAdapter("select * from ITEM where ITEM_NAME like '%" & TextBox1.Text & "%'", con) adp.Fill(ds) DataGridView1.DataSource = ds.Tables(0) con.Close() Catch ex As Exception con.Close() MsgBox(ex.Message) End Try End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load laoditem() End Sub End Class
Registrar usuario desde visual C# con SQL server
 
12:33
hola amgios y colegas espero que el video les haya sido de gran utilidad pues aki les dejo los codigos: try { System.Data.SqlClient.SqlConnection sqlConnection1 = new System.Data.SqlClient.SqlConnection("Data Source=.\\CHRISTIAN_SOFT; Initial Catalog = PRESTAMOS; Integrated Security=True;"); System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = "INSERT registrousuario (nombreempresa,nombreusuario,claveusuario,confirmarclave,tipocuenta) VALUES ('" + TxtNombreEmpresa.Text + "','" + TxtNombreUsuario.Text + "','" + TxtClaveUsuario.Text + "','" + TxtConfirmarClave.Text + "','" + Usuario.Text + "')"; cmd.Connection = sqlConnection1; sqlConnection1.Open(); cmd.ExecuteNonQuery(); sqlConnection1.Close(); MessageBox.Show("Se ha creado un usuario exitosamente."); this.Close(); } catch { MessageBox.Show("Error al intentar ingresar los datos en la base de datos"); this.TxtClaveUsuario.Clear(); this.TxtConfirmarClave.Clear(); } Grupo Programadores.NET https://www.facebook.com/groups/438252976225106/467481703302233/?comment_id=467483929968677&notif_t=group_comment
Views: 3645 ChristianTechnology1
Pos receipt printing/bill printing
 
03:47
In this tutorial i have taught how to get printed pos receipts.If anything please comment down.. code part button code var receipt = new PrintDocument(); receipt.PrintPage += new PrintPageEventHandler(PrintPage); receipt.Print(); private void PrintPage(object sender, PrintPageEventArgs e) { Graphics graphics = e.Graphics; Font font = new Font("Courier New", 10); float fontHeight = font.GetHeight(); int startX = 0; int startY = 0; int Offset = 20; e.PageSettings.PaperSize.Width = 50; graphics.DrawString("Welcome to Pizza Shop", new Font("Courier New", 8), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString("Bill Date :" + "30/3/2019", new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; String underLine = "------------------------------------------"; graphics.DrawString(underLine, new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); underLine = "------------------------------------------"; graphics.DrawString(underLine, new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString(underLine, new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString("item".PadRight(15) + "Rate".ToString().PadRight(15) + " " + "qty".ToString().PadRight(15) + " " +"tot".ToString().PadRight(15), new Font("Arial Bold", 9), new SolidBrush(System.Drawing.Color.Black), 20, startY + Offset); Offset = Offset + 20; underLine = "------------------------------------------"; graphics.DrawString(underLine, new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 60; SqlConnection con = new SqlConnection("Data Source=DESKTOP-UHKOLKK\\SQLEXPRESS;Initial Catalog=testdb;User ID=sa;Password=123"); SqlCommand cmd = new SqlCommand("select *from testtable", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); foreach (DataRow dr in dt.Rows) { graphics.DrawString(dr["item"].ToString().PadRight(9) + dr["rate"].ToString().PadRight(9) + " " + dr["qty"].ToString().PadRight(5) + " " + dr["tot"].ToString().PadRight(15) , new Font("Courier New", 8), new SolidBrush(System.Drawing.Color.Black), 20, startY + Offset); Offset = Offset + 20; } } It is said that knowledge is gained through learning and experiences. However, I differ on this. I believe knowledge is gained through sharing. Being a software engineer, this blog is devoted to sharing my knowledge on software coding through a process of tutorials. You are welcome to share your feedback on the tutorials, enabling me to improve further. Contact me on facebook : https://www.facebook.com/CutegalCoco Write Main on: [email protected]
pos bill with barcode
 
03:42
in this tutorial i have taught how to print pos bill with barcode.. previous video link https://www.youtube.com/watch?v=y18G6ruLCS0&list=PLJ3JCp4VXg0ps5SfocaEVm75h0zOw_kUg&index=2&t=0s source code private void button1_Click(object sender, EventArgs e) { var receipt = new PrintDocument(); receipt.PrintPage += new PrintPageEventHandler(PrintPage); receipt.Print(); } private void PrintPage(object sender, PrintPageEventArgs e) { Graphics graphics = e.Graphics; Font font = new Font("Courier New", 10); float fontHeight = font.GetHeight(); int startX = 0; int startY = 0; int Offset = 20; e.PageSettings.PaperSize.Width = 50; graphics.DrawString("Welcome to Pizza Shop", new Font("Courier New", 8), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString("Bill Date :" + "30/3/2019", new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; String underLine = "------------------------------------------"; graphics.DrawString(underLine, new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); underLine = "------------------------------------------"; graphics.DrawString(underLine, new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString(underLine, new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString("item".PadRight(15) + "Rate".ToString().PadRight(15) + " " + "qty".ToString().PadRight(15) + " " + "tot".ToString().PadRight(15), new Font("Arial Bold", 9), new SolidBrush(System.Drawing.Color.Black), 20, startY + Offset); Offset = Offset + 20; underLine = "------------------------------------------"; graphics.DrawString(underLine, new Font("Courier New", 14), new SolidBrush(System.Drawing.Color.Black), startX, startY + Offset); Offset = Offset + 20; //chnge as per ur logic,change the connection string SqlConnection con = new SqlConnection("Data Source=DESKTOP-UHKOLKK\\SQLEXPRESS;Initial Catalog=testdb;User ID=sa;Password=123"); SqlCommand cmd = new SqlCommand("select *from testtable", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); foreach (DataRow dr in dt.Rows) { graphics.DrawString(dr["item"].ToString().PadRight(9) + dr["rate"].ToString().PadRight(9) + " " + dr["qty"].ToString().PadRight(5) + " " + dr["tot"].ToString().PadRight(15), new Font("Courier New", 8), new SolidBrush(System.Drawing.Color.Black), 20, startY + Offset); Offset = Offset + 20; } // //this region generates barcode var content = "hi folks";//change the content as per ur requirements var writer = new BarcodeWriter { Format = BarcodeFormat.CODE_128, Options = new ZXing.Common.EncodingOptions { Height = 75, Width = 75 } }; var bitmap = writer.Write(content); graphics.DrawImage(bitmap, 60, startY + Offset); } It is said that knowledge is gained through learning and experiences. However, I differ on this. I believe knowledge is gained through sharing. Being a software engineer, this blog is devoted to sharing my knowledge on software coding through a process of tutorials. You are welcome to share your feedback on the tutorials, enabling me to improve further. Contact me on facebook : https://www.facebook.com/CutegalCoco Write Mail on: [email protected] #pos billing machine #pos billing #pos bill printing c# #smart bill pos #barcode billing system #barcode billing #barcode generator c# #barcode generator and printer #barcode generator app for pc #barcode generator c# source code #pos receipt printer #pos receipt printing c# #pos receipt printing software #pos receipt report using c# complete - fast receipt printing solution
Search or Filter Data in GridView Using CheckBox in Asp.Net | Hindi
 
11:11
Hello Friends, Subscribers, Students, In This Video You Will Learn How to Search or Filter Data in GridView Using CheckBox in Asp.net. We can Search Data in GridView with the Help of CheckBox Enabled Value. --- Important Coding ------------------------------- String filterdata=""; if (CheckBox1.Checked) { if (CheckBox2.Checked || CheckBox3.Checked) { filterdata = "'Amritsar',"; } else { filterdata = "'Amritsar'"; } } if(CheckBox2.Checked) { if (CheckBox3.Checked) { filterdata = filterdata+"'Jalandhar',"; } else { filterdata = filterdata+"'Jalandhar'"; } } if (CheckBox3.Checked) { filterdata = filterdata+"'Delhi'"; } String mycon = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=StudentData; Integrated Security=True"; SqlConnection con = new SqlConnection(mycon); con.Open(); String myquery = "Select * from StudentInfo where city in("+filterdata+")"; SqlCommand cmd = new SqlCommand(); cmd.CommandText = myquery; cmd.Connection = con; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); con.Close(); -------------- Subscribe Our YouTube Channel - Like, Comment & Share Our Videos https://www.youtube.com/haritistudyhubeasylearn -------------- Like & Share Our Facebook Page http://www.facebook.com/HaritiStudyHub -------------- if You Have Any Problem and Doubt in Programming Language Feel Free to Email Us BestStudyGuru @ Gmail.Com --------------
Part3 Managing Content Using GridView table within ASP.Net project using C#
 
10:40
Example: To Edit record when the row is selected //protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) GridViewRow row = GridView1.Rows[e.NewEditIndex]; string name; name = row.Cells[3].Text; SqlConnection conn = new SqlConnection("Data Source=localhost\\SqlExpress;Initial Catalog=dad;Integrated Security=True"); String sql; sql = "update phone set num ='" + TextBox1.Text + "' where (nam ='" + name + "' )"; SqlCommand comm = new SqlCommand(sql, conn); conn.Open(); comm.ExecuteNonQuery(); conn.Close(); Example: To buy when the row is selected string sql, sql2; sql = "UPDATE items SET quantity = quantity - 1 where (name ='" + name + "' )"; SqlCommand comm = new SqlCommand(sql, conn); conn.Open(); comm.ExecuteNonQuery(); sql2 = "SELECT * FROM items where name ='" + name + "' "; SqlCommand comm2 = new SqlCommand(sql2, conn); SqlDataReader reader = comm2.ExecuteReader(); SqlCommand comm2 = new SqlCommand(sql2, conn); SqlDataReader reader = comm2.ExecuteReader(); if (reader.Read()) { Label1.Text = " you must pay" + (int)reader["price"]; } reader.Close(); conn.Close(); GridView1.DataBind(); GridView1.DataBind();
Views: 327 Aiman Turani
ربط SQL_Server بــ #C
 
09:16
دورة_c_شارب السلام عليكم ورحمة الله وبركاته الدرس الأول في C# lu مع sqlserver في هذا الدرس سنتعلم كيفية فتح ال SQLServer2012 وإنشاء قاعدة ثم إنشاء جدول بعد ذلك سنتعلم في نفس الفيديو كيفية ربط القاعدة بــ #C وإختبار الإتصال تابع الفيديو ولمن لديه أي استفسار يتفضل بطرحه في التعليقات الكود الخاص بالكلاس DB class DBconn { SqlConnection con; public bool testconn() { bool state; con = new SqlConnection(); con.ConnectionString = "Data Source=SAAD-PC;Initial Catalog=school1;Integrated Security=True"; con.Open(); if (con.State == System.Data.ConnectionState.Open) state = true; else state = false; return state; } } الكود الخاص بالزر TEST DBconn cn = new DBconn(); if (cn.testconn() == true) MessageBox.Show("تم الإتصال بنجاح"); else MessageBox.Show("لم ينجح الإتصال باقاعدة"); نرجو الإستفادة للجميع
Insert Method using ObjectDataSource in ASP.NET | GridView FooterRow Insert ObjectDataSource
 
13:52
Hello Friends, In this Video You will learn how to use insert method of objectdatasource in asp.net to insert data into gridView using Footer Row of GridView. ---- Coding -------------------------- public DataSet GetCustomerDetail1() { String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=customerdatabase; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); String query = "select * from customerdetail"; SqlCommand sqlcmd = new SqlCommand(); sqlcmd.CommandText = query; sqlcmd.Connection = sqlcon; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = sqlcmd; DataSet ds = new DataSet(); da.Fill(ds); return ds; } public int InsertCustomerDetail(int customerid, String customername, String city, String contact) { String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=customerdatabase; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); String query = "Insert into customerdetail(customerid,customername,city,contact) values(" + customerid + ",'" + customername + "','" + city + "','" + contact + "')"; SqlCommand sqlcmd = new SqlCommand(query, sqlcon); sqlcon.Open(); sqlcmd.ExecuteNonQuery(); sqlcon.Close(); return customerid; } ------------ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GridView1.DataSource = ObjectDataSource1; GridView1.DataBind(); } } protected void Button1_Click(object sender, EventArgs e) { ObjectDataSource1.InsertParameters["customerid"].DefaultValue = (GridView1.FooterRow.FindControl("TextBox1") as TextBox).Text; ObjectDataSource1.InsertParameters["customername"].DefaultValue = (GridView1.FooterRow.FindControl("TextBox2") as TextBox).Text; ObjectDataSource1.InsertParameters["city"].DefaultValue = (GridView1.FooterRow.FindControl("TextBox3") as TextBox).Text; ObjectDataSource1.InsertParameters["contact"].DefaultValue = (GridView1.FooterRow.FindControl("TextBox4") as TextBox).Text; ObjectDataSource1.Insert(); GridView1.DataSource = ObjectDataSource1; GridView1.DataBind(); }
PROGRAMACIÓN | Aplicación Web con ASP.NET para conectarse a base de datos en Visual
 
03:37
public String conectar() {//Metodo de prueba de conexion a BD String sqlcadena = "Data Source=.;Initial Catalog=Northwind;integrated security=true"; SqlConnection con = new SqlConnection(sqlcadena); try { con.Open(); return "Conexion Satisfactoria a SQL Server 2014 con C#"; } catch (Exception ex) { return ex.Message; } } public SqlConnection conecta() { String sqlcadena = "Data Source=.;Initial Catalog=Northwind;integrated security=true"; SqlConnection con = new SqlConnection(sqlcadena); try { con.Open(); return con; } catch (Exception ex) { return null; } }
Views: 14 el Tío Narco
Tutorial no. 1:Urdu and Hindi Tutorial CRUD Insert data into database in ASP.net using C#
 
09:57
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; namespace WebApplication4 { public partial class Catagories : System.Web.UI.Page { static int id; string connection = @"Data Source=.;Initial Catalog=SMSVeahri;Integrated Security=True"; protected void Page_Load(object sender, EventArgs e) { display(); } protected void Button1_Click(object sender, EventArgs e) { uploadimage(); if (Button1.Text == "Insert") { SqlConnection con = new SqlConnection(connection); con.Open(); SqlCommand cmd = new SqlCommand("INSERT INTO Categories (Title, Description, Icone) VALUES ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + lblpath.Text + "')", con); cmd.ExecuteNonQuery(); con.Close(); } else { SqlConnection con = new SqlConnection(connection); SqlCommand cmd = new SqlCommand("Update Categories Set Title='" + TextBox1.Text + "', Description='" + TextBox2.Text + "', Icone='" + lblpath.Text + "' WHERE (ID='" + id + "')", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); } display(); clear(); } public void clear() { TextBox1.Text = ""; TextBox2.Text = ""; lblpath.Text = ""; Button1.Text = "Insert"; Button2.Visible = false; Button3.Visible = false; } public void uploadimage() { if (FileUpload1.HasFile) { string fileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName); FileUpload1.PostedFile.SaveAs(Server.MapPath("~/images/" + fileName)); lblpath.Text = "~/images/" + fileName; } } public void display() { SqlConnection con = new SqlConnection(connection); SqlDataAdapter da = new SqlDataAdapter("SELECT ID, Title, Description, Icone FROM Categories WHERE Status=1", con); DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { Button1.Text = "Update"; Button2.Visible = true; Button3.Visible = true; id = Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text); TextBox1.Text = GridView1.SelectedRow.Cells[2].Text; TextBox2.Text = GridView1.SelectedRow.Cells[3].Text; lblpath.Text = GridView1.SelectedRow.Cells[4].Text; } protected void Button2_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(connection); SqlCommand cmd = new SqlCommand("Update Categories Set Status=0 WHERE ID=('" + id + "')", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); clear(); display(); } protected void Button3_Click(object sender, EventArgs e) { clear(); display(); } } }
Views: 126 Waseem Akram
Part 7   What is SqlMetal
 
06:35
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/09/part-7-what-is-sqlmetal.html In this video we will discuss 1. What is SqlMetal 2. How to use SqlMetal What is SqlMetal SqlMetal is a command-line code generation tool used to generate LINQ-to-SQL classes. There are 2 ways to generate LINQ-to-SQL classes 1. Uisng Visual Studio OR 2. Using SqlMetal What is the windows path where I can find SqlMetal.exe On my machine SqlMetal.exe is present in the following location C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin How to use SqlMetal.exe to generate the LINQ-to-SQL classes Step 1 : Run Visual Studio Command prompt as an Administrator Step 2 : In C:\ create a new folder. Name it SqlMetalGeneratedFiles. This is the folder where we will store the generated dbml file. Step 3 : Type the following command and press enter SqlMetal.exe /server:localhost /database:Sample /namespace:Demo /dbml:C:\SqlMetalGeneratedFiles\Sample.dbml /Context:SampleDataContext In this example we are using the following options server - Database server name. In our example, the database server is a local server, hence we specified localhost. database - database name dbml - The name of the generated dbml file namespace - Namespace for the generated classes context - Name of the data context class For the full list of all available options that can be used with SqlMetal.exe, please check the following MSDN article http://msdn.microsoft.com/en-gb/library/vstudio/bb386987(v=vs.100).aspx Navigate to C:\SqlMetalGeneratedFiles\ and you should find Sample.dbml Let's now discuss using Sample.dbml file in an ASP.NET Web Application. Step 1 : Create a new empty asp.net web application project. Name it Demo. Step 2 : In the web.config file, copy and paste the following connection string [connectionStrings] [add name="SampleConnectionString" connectionString="Data Source=(local);Initial Catalog=Sample;Integrated Security=True" providerName="System.Data.SqlClient" /] [/connectionStrings] Step 3 : Right click on the Demo project, in solution explorer and select Add - Existing Item. Navigate to C:\SqlMetalGeneratedFiles and add Sample.dbml. Step 4 : Add a WebForm to the project. Drag and drop a GridView control on the WebForm. Copy and paste the following code in the code-behind file. using System; using System.Configuration; namespace Demo { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string cs = ConfigurationManager.ConnectionStrings["SampleConnectionString"].ConnectionString; using (SampleDataContext dbContext = new SampleDataContext(cs)) { GridView1.DataSource = dbContext.Employees; GridView1.DataBind(); } } } }
Views: 22439 kudvenkat
Add/Insert data into SQL Server Table from excel using C#
 
04:35
this video is guide about how to add excel data into SQL Server Table from using C# (Note: Paste below code in visual studio) button1_click code here protected void Button1_Click(object sender, EventArgs e) { string DBconnecStr = "Password=abc!1234;Persist Security Info=True;User ID=sa;Initial Catalog=TempSample;Data Source=.;pooling=false;connection Timeout=9000"; //fetch sql connection OleDbConnection con = new OleDbConnection(); SqlConnection consql = new SqlConnection(DBconnecStr); consql.Open(); SqlTransaction trans = consql.BeginTransaction(IsolationLevel.Serializable); if (FileUpload1.HasFile) { string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName); //get Filename string Extension = Path.GetExtension(FileUpload1.PostedFile.FileName); // get Extension string FolderPath = Path.GetPathRoot(FileUpload1.PostedFile.FileName); string FilePath = Server.MapPath(FolderPath + FileName); // Get Filepath try { FileUpload1.SaveAs(FilePath); string connStr = ""; if (Extension.ToString() == ".xls") { connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties='Excel 8.0;HDR={1}'"; } else if (Extension.ToString() == ".xlsx") { connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 8.0;HDR={1}'"; } else { Label1.Text = "File has invalid extension for excel"; return; } DataTable dsExcel = FecthFromExcel(FilePath, Extension, connStr); //insert into datatabe from excel foreach (DataRow datro in dsExcel.Rows) { SqlCommand cmdIns = new SqlCommand(" insert into table_11 values ('" + datro["id"].ToString() + "','" + datro["name"].ToString() + "') ", consql, trans); cmdIns.ExecuteNonQuery(); } Label1.Text = "Data has inserted.."; trans.Commit(); consql.Close(); } catch (Exception ex) { trans.Rollback(); consql.Close(); throw ex; } } } ---------------------------------------------------------------------------------------------------------------------------------------- private DataTable FecthFromExcel(string FilePath, string Extension, string xlConnEc) { try { string connStr = String.Format(xlConnEc, FilePath,"YES"); OleDbConnection conExcel = new OleDbConnection(connStr); conExcel.Open(); DataTable dt = new DataTable(); DataTable dtExcelSchema = conExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); string SheetName = "Sheet1$"; string query = "SELECT id,name FROM [" + SheetName + "] "; OleDbCommand cmdExcel = new OleDbCommand(); cmdExcel.Connection = conExcel; cmdExcel.CommandText = query; OleDbDataAdapter oda = new OleDbDataAdapter(cmdExcel); oda.Fill(dt); conExcel.Close(); return dt; } catch (Exception ex) { throw ex; } } ---------------------------------------------------------------------------------------------------------------------------------------- CREATE TABLE [dbo].[Table_11]( [id] [nchar](10) NULL, [name] [nchar](10) NULL ) ON [PRIMARY] GO select * from Table_11
Views: 40 Parag Gharate

Here!
Real sex fucking manachain
Ano sefe ponorka online dating
Here!
Jogo benfica vs sporting em directo online dating