Home
Search results “Initial catalog connection string”
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: 214576 kudvenkat
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: 35157 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: 13287 Asp Web
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: 2157 Flash25
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: 164 Shubham K Gupta
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: 886 Tenki
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: 27644 SQLnuggets
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: 130 Samuel Gonzalez
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: 13014 Asp Web
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: 1490 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: 490 Aiman Turani
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: 259 Aiman Turani
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: 21387 kudvenkat
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: 191 Aiman Turani
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: 206 Munish Arora
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: 29949 DataCamp
ZKTime 5.0 : Setting ZK Attendance Management with SQL Server Database
 
03:07
This is a tutorial about how to set ZKTime 5.0 to work with a SQL Server database instead of the default MS Access. This is very useful if you want to connect several users to the same attendance information.
Views: 10429 ZKTeco.MA
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: 126 Bashar Bachir
Blue Prism Video Tutorial | 006 | Configuring SQL server for Blue Prism
 
01:55
This video will walk you through the configuration of SQL Server express edition for installing Blue Prism
Views: 79492 Busy Ping
Sql Connection using Class (C#)
 
07:51
Sql Connection using Class File. (C#) More: http://www.asm.com.np
Views: 48400 Aka Asis
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: 35 Dawood Anwar
Change the connection string dynamically for SQLDataSource during run time
 
03:04
Change the connection string dynamically for SQLDataSource during run time
Views: 15033 Ming Dynasty
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: 12100 Ming Dynasty
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: 762 Aiman Turani
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 --------------
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: 6 Parag Gharate
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: 36436 Mind blowing videos
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: 113 Waseem Akram
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: 175891 Michael Perrenoud
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: 43 Elmer Ze
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 --------------
ASP .Net part 93 Build Our App   Register our DbContext
 
03:25
Build Our App Register our DbContext We're going to generate our E-F core contex for our log and register model and lease and before we do that I want you to look at my connection string in my app settings that Jason and you'll notice right here for the initial catalog I have profiled D-B. So once we generate this contex and it creates the database in sequel's serve our local D-B you'll see the database name to be profiled D-B.
Views: 1 SEO PanditG
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 --------------
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: 25 Waseem Akram
Curso de Programação C# - Parte 15
 
09:15
www.MauricioJunior.org Utilizado: - Visual Studio - Linguagem C# - SQL Server Detalhes: - Conecte seu projeto ao banco de dados facilmente com essa vídeo aula. Aprenda a criar a connection string e depois puxar os valores para dentro do C#. Connection String: - Não esqueça do Data Source = nome do servidor - Não esqueça do Initial Catalog = nome do banco de dados - Não esqueça do User = usuário do banco de dados - Não esqueça do Password = senha do banco usuário que acessa o banco de dados Artigo relacionado: http://www.ecode10.com/artigo/1930/ADO-NET-e-conexao-SQL-Server
Views: 822 MauricioJunior.org
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: 435 LogoSupport
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: 3606 David Stovell
Part 8  Data access in mvc using entity framework
 
13:29
Tags asp.net mvc database tutorial asp.net mvc database application tutorial creating asp.net mvc application with database asp.net mvc database connection using entity framework asp.net mvc database project database connectivity in asp.net mvc Text version of the video http://csharp-video-tutorials.blogspot.com/2013/05/part-8-data-access-in-mvc-using-entity.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-8-data-access-in-mvc-using-entity.html All ASP .NET MVC Text Articles http://csharp-video-tutorials.blogspot.com/p/aspnet-mvc-tutorial-for-beginners.html All ASP .NET MVC Slides http://csharp-video-tutorials.blogspot.com/p/aspnet-mvc-slides.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists The controller responds to URL request, gets data from a model and hands it over to the view. The view then renders the data. Model can be entities or business objects. In part 7, we have built Employee entity. public class Employee { public int EmployeeId { get; set; } public string Name { get; set; } public string Gender { get; set; } public string City { get; set; } } In this video, we will discuss, retrieving data from a database table tblEmployee using entity framework. In a later video, we will discuss using business objects as our model. Step 1: Install entity framework, if you don't have it installed already on your computer. At the time of this recording the latest version is 5.0.0.0. Using nuget package manager, is the easiest way to install. A reference to EntityFramework.dll is automatically added. Open visual studio - Tools - Library Package Manager - Manage NuGet Packages for Solution Step 2: Add EmployeeContext.cs class file to the Models folder. Add the following "using" declaration. using System.Data.Entity; Copy & paste the following code in EmployeeContext.cs public class EmployeeContext : DbContext { // Replace square brackets, with angular brackets public DbSet[Employee] Employees {get; set;} } EmployeeContext class derives from DbContext class, and is responsible for establishing a connection to the database. So the next step, is to include connection string in web.config file. Step 3: Add a connection string, to the web.config file, in the root directory. Step 4: Map "Employee" model class to the database table, tblEmployee using "Table" attribute as shown below. [Table("tblEmployee")] public class Employee { public int EmployeeId { get; set; } public string Name { get; set; } public string Gender { get; set; } public string City { get; set; } } Note: "Table" attribute is present in "System.ComponentModel.DataAnnotations.Schema" namespace. Step 5: Make the changes to "Details()" action method in "EmployeeController" as shown below. public ActionResult Details(int id) { EmployeeContext employeeContext = new EmployeeContext(); Employee employee = employeeContext.Employees.Single(x =] x.EmployeeId == id); return View(employee); } Step 6: Finally, copy and paste the following code in Application_Start() function, in Global.asax file. Database class is present "in System.Data.Entity" namespace. Existing databases do not need, database initializer so it can be turned off. Database.SetInitializer[MVCDemo.Models.EmployeeContext](null); That's it, run the application and notice that the relevant employee details are displayed as expected.
Views: 634036 kudvenkat
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: 41938 Yenier Venegas
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: 4197 Professor Well
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: 140 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("لم ينجح الإتصال باقاعدة"); نرجو الإستفادة للجميع
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: 418 Ozi TR
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(); } ----
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: 2015 Israel Fx
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: 1068 László Juhász
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: 875 Adhiraj Jaryal
insertar, actualizar, buscar y eliminar datos en vb .net con sql server Parte I.mp4
 
13:58
AQUI ESTAN LOS ENLACES A LAS DEMAS PARTES Autor: Arismendy Rodriguez www.arcompu.com http://www.facebook.com/arismendy.rod... Siganme en twitter para mas ayudas: @mendy123z AQUI ESTAN LOS ENLACES A LAS DEMAS PARTES PARTE2 http://www.youtube.com/watch?v=4teabolTEeQ PARTE 3 http://www.youtube.com/watch?v=HSrMSHbVr1k PARTE 4 http://www.youtube.com/watch?v=aWmOT7aXp3o PARTE 5 y final http://www.youtube.com/watch?v=PC2CxDInd-U insertar, actualizar, buscar y eliminar datos en vb .net con sql server Parte I A continuación les escribo el código utilizado hasta ahora por si algo no se aprecia del todo bien en el video. Código del Modulo: 'lo prinmero que debemos hacer es crear las importaciones de nombres Imports System.Data Imports System.Data.SqlClient Module Module1 'dentro del modulo crearemos una varible publica para manejar la conexion Public con As New SqlConnection 'declaramos un nuevo procediemiento para el manejo de la cadena de conexion Public Sub coneccion() 'asignamos la cadena de conexion con.ConnectionString = " Data Source=ARISMENDY-PC\SQLEXPRESS;Initial Catalog=as;Integrated Security=True" End Sub End Module Codigo del formulario Imports System.Data Imports System.Data.SqlClient Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load coneccion() MostrarDatos() End Sub Public Sub MostrarDatos() 'declaramos la variable que nos servira para realizar la consulta 'esta sera un sqldataadapter If Not con.State = ConnectionState.Open Then con.Open() End If Dim dt As New SqlDataAdapter("select * from usuario", con) 'luego declaramos un dataset que sera el que maneje los datos 'traidos de la consulta Dim ds As New DataSet 'luego llenamo el dataset utilizando el metodo fill del dataadapter dt.Fill(ds, "usuario") 'luego le asignamos el dataset al datagrid para mostrar los datos 'que hay hasta el momento dgVista.DataSource = ds dgVista.DataMember = "usuario" 'luego cerramos la conexion ' con.Close() ' End Sub End Class Esperen las siguientes partes
Views: 68838 Arismendy Rodríguez
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: 3274 Arix XDcs

Computer service technician cover letter
School admission cover letter example
Entry level programmer cover letter examples
Press release service writing
Wolfe and associates application letters