Home
Search results “Initial catalog connection string”
C# Tutorial - Change ConnectionString at Runtime with App.config | FoxLearn
 
12:47
How to change ConnectionString dynamically in C#. 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 Change the connection string dynamically for SQLDataSource during run time c# global connectionstring (configurationmanager.connectionString) Get and set C# application settings in runtime How to create a ConnectionString in web.config to SQL server using C# How to Read ConnectionString from App config file in Visual Studio App.config in c# for creating global ConnectionString
Views: 42071 Fox Learn
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: 15933 Asp Web
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: 229502 kudvenkat
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: 1142 Tenki
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: 200 Shubham K Gupta
(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: 1537 The Knowledge Adda
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: 3723 SAHYADRI TECHNOLOGY
How to Create Database Connection String using UDL file
 
00:44
this video contain the short demonstration of how to create connection string using udl file. after successfully creating udl file open the file in notepad it shows [oledb] ; Everything after this line is an OLE DB initstring Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=agency;Data Source=NFS-PC\SQLEXPRESS string from provider to sqlexpress
Views: 2328 Flash25
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
Entity Framework Connection String
 
09:15
Shows setting up an entity framework connection string to connect to SQL Server.
Views: 22544 Jamie King
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: 146 Bashar Bachir
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: 591 Aiman Turani
MACRO QUE MANIPULA EL SQL DESDE EL EDITOR VBA DE EXCEL
 
00:51
LES COMPARTO PARTE DEL CODIGO... EN ESTE METODO SE DESARROLLA LA CONEXION A SQL SERVER Public Sub METODO() Set conexion = New ADODB.Connection Set consulta = New ADODB.Recordset Dim String1 As String conexion.ConnectionString = "Provider=SQLOLEDB;Data Source=CUPERTINO;Initial Catalog=UNIV;User ID=sa;Password=;" conexion.Open String1 = "SELECT * FROM BLAH BLAH" Set consulta.ActiveConnection = conexion consulta.Open String1 End Sub
Views: 2115 Israel Fx
Storing SSIS Package Config in SQL Server using an Environment Variable and a .dtsconfig XML file.
 
09:29
This video explains & shows how to use an Environment Variable to hold the location of an XML .dtsconfig file that holds the connect string to a SQL Server database. This SQL Server DB is used to hold all the other package config and this video shows how to create the initial XML file, then assign an environment variable in package configurations, and finally how to store secondary config information into a SQL table located within the config SQL server database (who's connection is stored in the XML Config file.) Please view the ERRATA video as well, small error.
Views: 28979 SQLnuggets
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(); } } }
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: 18429 Asp Web
How to Create Connection string in Visual studio 2010 to SQL Server 2008 in properties window?
 
03:04
This video illustrates how to create connection string using Visual studio 2010 to SQL Server 2008 and get it displayed in properties window. Connect with Author on LinkedIn: in.linkedin.com/in/mdnaseer Our website: http://goo.gl/Np6yLJ Follow Author on Twitter: http://twitter.com/m_d_naseer Like us on Facebook: http://www.facebook.com/softwaretechnology.info
Views: 37492 Mind blowing videos
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: 40 Dawood Anwar
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: 22254 kudvenkat
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 --------------
SQLAlchemy: Connecting to a database
 
03:10
Learn how to connect to your database: https://www.datacamp.com/courses/introduction-to-relational-databases-in-python In the python world, there are several great tools that we can use when working with databases. One of those is SQLAlchemy that we will be using throughout this course. SQLAlchemy will allow us to generate SQL queries by writing Python code. You should still consider learning how to write queries in SQL as well. SQLAlchemy has two main components. The part we will be focusing on is often referred to as "core" part of SQLAlchemy. It's really focused around the relational model of the database. Additionally, there is the Object Relational Model or ORM part of SQLAlchemy that is really focused around data models and classes that you as a programmer create. There are many different types of databases, and each database type has its own quirks and unique capabilities. You'll commonly find SQLite, PostgreSQL, MySQL, Microsoft SQL Server, and Oracle when working with data. SQLAlchemy provides a way to operate across all of these database types in a consistent manner. To connect to a database, we need a way to talk to it, and an engine provides that common interface. To create an engine, we import the create_engine function from sqlalchemy; we then use the create_engine function and supply it a connection string that provides the details needed to connect to a database. Finally once we have an engine, we are ready to make a connection using the connect method on the engine. It's worth noting that SQLAlchemy won't actually make the connection until we give it some work to execute. So to review, an engine is the common interface to the database, which requires a connection string to provide the details used to find and connect to the database. Before we go any further, let's talk a bit more about connection strings. In their simplest form, they tell us what kind of database we are talking to and how we should access it. In this example, you can see that we are using the sqlite database driver and the database file named census_nyc.sqlite which is in the current directory. Now that we have an engine and a connection, we need to know what tables are in the database. We'll start again by importing the create_engine function and creating an engine to our database. Finally, We can use the table_names method of the engine which returns a list of tables. Once we know what table we want to work on, we need a way to access that table with python. To do that we are going to use a handy process called reflection, which reads the database and builds a Table object that we can use in our code. We already have created our engine, so we begin by importing the MetaData and Table objects needed for reflection. The MetaData object is a catalog that stores database information such as tables so we don't have to keep looking them up. To reflect the table, we initialize a MetaData object. Next, we use the SQLAlchemy Table object and provide the table name we got earlier from the table_names method. We also supply our metadata instance, and then instruct it to autoload the table using the engine. Finally, we can use the function repr to view the details of our table that we stored as census. This allows us to see the names of the columns, such as 'state' and 'sex', along with their types, such as VARCHAR and INTEGER. This process of reflection may seem a bit of an overhead, but it will make understanding your databases and extracting information from them far easier downstream. Now it's your turn to practice writing connection strings, connecting to databases and reflecting tables. Then we'll be back here writing our first SQL queries.
Views: 37747 DataCamp
MySQL Workbench: Connection Creation and Trouble Shooting (for beginners)
 
23:50
This video shows how to create connections in MySQL Workbench and what to do if problems arise with that. Please subscribe to the MySQL Youtube channel: http://www.youtube.com/mysqlchannel Like our MySQL Facebook page: http://facebook.com/mysql Follow us on Twitter at: http://twitter.com/mysql
Views: 371208 MySQL
Ssis Project Parameters
 
24:44
In this video, we make a new SSIS project where-in we create Project Parameters, which store the following at project leevl • ServerName • Initial Catalog Thereafter we will Deploy this and change servername after deployment at SQL Server, and thereafter Create a SQL Server Agent Job, which runs this package at scheduled time
Views: 362 Munish Arora
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: 253 Aiman Turani
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: 434 Ozi TR
Lab 10 - Define Connection Strings to SQL SERVER - מעבדה 10
 
14:15
במעבדה זו נלמד כיצד להגדיר חיבורים (Connection Strings) בקובץ הקונפיגורציה של האפליקציה web.config נלמד כיצד להגדיר את החיבור אם אנו מתחברים בשיטת Windows Authentication או אם מתחברים בשיטת SQL Server Authentication
Views: 181 Ran Shahak
Change the connection string dynamically for edmx Entity during run time
 
01:56
Change the connection string dynamically for edmx Entity during run time
Views: 12938 Ming Dynasty
PROG1440 Entity Framework Many To Many with Two List Boxes
 
25:17
Too many options for Check Boxes? Try using 2 List Boxes, one for selected and one for available options. Apparently my link to download the code stopped working so I put the code for both the checkbox and listbox examples here: https://1drv.ms/f/s!At-Flvwi1_4GlLM68JT5ZZFdMEFzKQ No claims about these code example (use at your own risk) but they are what we created in the videos. NOTE: If you are using LocalDB, change the connection string to something like this: connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\MtoM.mdf;Initial Catalog=MtoM;Integrated Security=True" NEW: How to filter by a value on the other side of the many-to-many. See Part 3 at: http://youtu.be/5jcFowsdUHY
Views: 3753 David Stovell
how to create contact form and insert to  Data in database!!!!
 
27:14
visit Website :- Webdevelopermaster.com Email ID:- [email protected] Episode 01 how to create contact form and insert to Data in database!!!! Simple Code in Create Contact Form And Insert Data DATABASE. conatct From create in use textbox and button and btnonclick event create. after web Configuration ::::-----{ add name="DEMO" connectionString="Data Source=DHARMENDRA\SQLEXPRESS;Initial Catalog=demo_view;User ID=sa;Password=************"/ } And Insert code in cs file 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; using System.Configuration; public partial class _Default : System.Web.UI.Page { SqlConnection sqlc = new SqlConnection(); SqlCommand cmd; protected void Page_Load(object sender, EventArgs e) { sqlc = new SqlConnection(ConfigurationManager.ConnectionStrings["DEMO"].ConnectionString); if(!IsPostBack) { } } protected void btnsubmit_Click(object sender, EventArgs e) { sqlc.Open(); cmd = new SqlCommand("insert into DEMO (NAME, LAST_NAME,EMAIL_ID,PHONE,MESSAGE) VALUES (@name,@last_name,@email_id,@phone,@message)",sqlc); cmd.Parameters.AddWithValue("@name",txtname.Text); cmd.Parameters.AddWithValue("@last_name",txtlastname.Text); cmd.Parameters.AddWithValue("@email_id",txtemail.Text); cmd.Parameters.AddWithValue("@phone",txtphone.Text); cmd.Parameters.AddWithValue("@message",txtmessage.Text); cmd.ExecuteNonQuery(); sqlc.Close(); txtname.Text = ""; txtphone.Text = ""; txtmessage.Text = ""; txtlastname.Text = ""; txtemail.Text = ""; } }
Tutorial no. 2: Urdu and HindiCRUD display data from DataBase in gridview in ASP.NET using C#
 
03:51
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: 32 Waseem Akram
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
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: 1072 Aiman Turani
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: 124 Waseem Akram
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: 472 LogoSupport
SQL Server 2008-Visual Studio 2012 Listar un DataGridView Parte2
 
07:15
En el caso de Autenticacion de SQL Server ..solo se cambia la conexion ,lo demas es el mismo procedimiento .... //////////////////////Autenticacion de SQL Server//////////////////// :::::::::::Conectar Con el sevidor SQL ::::::::::::::: Tipo de servidor:Motor de base de datos Nombre del servidor:Ze Autenticacion: Autenticacion de SQL Server Inicio de sesion : sa Contraseña: 123456789 ClsConexion Public Class ClsConexion Public Function conexion() As String Dim sCn As String = "Connect Timeout=120; User Id=sa; Password=123456789;PersistSecurity Info=True;Initial Catalog=DBMantenimiento;Data Source=Ze" Return sCn End Function End Class Todo en una linea ;) Del dim hasta ze" --------------------------------------------------------------------------------------- /////////////////////////////////////////Autenticacion de windows///////////////// :::::::::::Conectar Con el sevidor SQL ::::::::::::::: Tipo de servidor:Motor de base de datos Nombre del servidor: Ze Autenticacìon:Autenticacion de windows En la clase ClsConexion escribir la siguiente función: Function conexion() As String Dim sCn As String = "Data Source=.;Database=DBMantenimiento;Integrated Security=True" Return sCn End Function ------------------------------------------------------------------------------- En la clase ClsProducto escribir la siguiente función: (Tener en cuenta el nombre del Procedimiento Almacenado) Public Function pus_pa_ListarProducto() As Data.DataSet Dim lobjExecute As New ABDMantenimiento.clsConexion Try Dim Ds As New DataSet Using oCn As New SqlConnection(lobjExecute.Conexion()) Using oCmd As New SqlCommand Using oDa As New SqlDataAdapter(oCmd) oCmd.Connection = oCn oCmd.CommandType = CommandType.StoredProcedure oCmd.CommandText = "pa_ListarProducto" oDa.SelectCommand.Connection = oCn oDa.Fill(Ds) pus_pa_ListarProducto = Ds End Using End Using End Using Catch 'Return 1 Finally lobjExecute = Nothing End Try End Function ---------------------------------------------------------------------------- Código de la Capa de Presentación: (Formulario) Declarando las variables Dim obj As New ABDMantenimiento.ClsProducto -------------------------------------------------------------------------------------- Codigo del Boton BtnListar Evento Click. dgvVentas.DataSource = obj.pus_Listar_Producto.Tables(0) dgvVentas.Columns(0).Visible = False
Views: 42 Elmer Ze
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: 281 Aiman Turani
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: 185819 Michael Perrenoud
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. ------------
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 --------------
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: 33 Parag Gharate
Tutorial no. 4: Urdu and Hindi CRUD delete data in ASP.NET using C#
 
02:30
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: 22 Waseem Akram
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: 43068 Yenier Venegas
ربط 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("لم ينجح الإتصال باقاعدة"); نرجو الإستفادة للجميع
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: 4151 Arix XDcs
Delete Method using ObjectDataSource in Asp.Net | Delete Data for Gridview using ObjectDataSource
 
10:14
Hello Friends, In this Video You will learn how to use delete method in objectdatasource. How to delete data in gridview using objectdatasource in asp.net c#. Deleting data from gridview using objectdatasource ------------ 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 void deleteCustomerDetail1(int customerid) { String constring = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=customerdatabase; Integrated Security=true"; SqlConnection sqlcon = new SqlConnection(constring); SqlCommand sqlcmd = new SqlCommand("delete from customerdetail where customerid=" + customerid, sqlcon); sqlcon.Open(); sqlcmd.ExecuteNonQuery(); sqlcon.Close(); } ----
Registration Form in Asp.Net C# with Sql Server Database | Live Example | Online Classes
 
12:43
Hello Friends, Students, Subscribers, In This Video Tutorial You will Learn How to Create Registration Web From in Asp.Net C# with Sql Server Database Connectivity for Save Data into Database, I Have Used Subtitles for All Users to Understand This Project Easily. Top 10 Best Books For Learn Asp.Net Programming : Buy and Learn ------------------------------------------------------------------------------------ 1. Asp.Net Black Book - Check it Now http://amzn.to/2vC2KfA 2. The Complete Reference Asp.Net - Check and Buy Now http://amzn.to/2x1H7FO 3. Beginning ASP.NET 4.5 in C# and VB - Check and Buy Now http://amzn.to/2ezyWsT 4. Microsoft Asp.Net 3.5: Step by Step - Check and Buy Now http://amzn.to/2vCoLuT 5. Beginning ASP.NET for Visual Studio 2015 - Check and Buy Now http://amzn.to/2ezaTKL 6. Professional ASP.NET 4.5 in C# and VB - Check and Buy Now http://amzn.to/2vVuwiI 7. Murachs ASP.NET 4.6 Web Programming with C# - Check and Buy Now http://amzn.to/2vVvFa1 8. Sams Teach Yourself ASP. NET In 21 Days - Check and Buy Now http://amzn.to/2ezlAN8 9. ASP.NET 4.5 in Simple Steps - Check and Buy Now http://amzn.to/2ev2JiK 10. Beginning ASP.NET 4.5 in C# (APRESS) - Check and Buy Now http://amzn.to/2eyZ2fG ------------------------------------------------------------------------------------ Important Coding ==== using System.Data; using System.Data.SqlClient; String query = "insert into newregister(uName,gender,contact,email,city) values('" + TextBox1.Text + "','" + DropDownList1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')"; String mycon = "Data Source=VIKAS-PC\\SQLEXPRESS; Initial Catalog=RegistrationFormData; Integrated Security=true"; SqlConnection con = new SqlConnection(mycon); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = query; cmd.Connection = con; cmd.ExecuteNonQuery(); Label3.Text = "New Registration Successfully 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 --------------
MVC   How to fix error   Keyword not supported metadata
 
00:35
An exception of type 'System.ArgumentException' occurred in System.Data.dll but was not handled in user code Additional information: Keyword not supported: 'metadata'.
Views: 6141 Vis Dotnet
SSIS Interview | How to write Expressions on Connection Managers in SSIS Package
 
05:42
In this video you will learn the answer of SQL Server Integration Services (SSIS) Interview Question " Can we write expression on Connection Managers? If yes, where would you need to do that? " Also learn What are connection managers in SSIS How to create connection managers in SSIS How to write expressions on Connections Managers in SSS How to write Expression on Connections Complete list of SSIS Interview Questions by Tech Brothers http://sqlage.blogspot.com/search/label/SSIS%20INTERVIEW%20QUESTIONS
Views: 8789 TechBrothersIT
Tutorial no. 3: Urdu and Hindi CRUD Update data in ASP.NET using C#
 
06:15
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: 19 Waseem Akram