Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,036

HOME > .NET Framework > .NET Parameterized Queries




Clound SSD Virtual Server

.NET Parameterized Queries

 
  .NET Parameterized Queries (Parameter Query) āļĢāļđāļ›āđāļšāļšāļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ€āļžāļ·āđˆāļ­āđ‚āļĒāļ™āļ„āđˆāļē Parameter āđƒāļŦāđ‰āļāļąāļš SQL Statement āđ€āļŦāļ•āļļāļœāļĨāļ—āļĩāđˆāđƒāļŠāđ‰āļžāļēāļĢāļēāļĄāļīāđ€āļ•āļ­āļĢāđŒ āļ—āļąāđ‰āļ‡āļ™āļĩāđ‰āļāđ‡āđ€āļžāļ·āđˆāļ­āļ•āđ‰āļ­āļ‡āļāļēāļĢāļ—āļĩāđˆāļˆāļ°āļ—āļģāļāļēāļĢāļāļģāļŦāļ™āļ”āļ„āļļāļ“āļŠāļĄāļšāļąāļ•āļīāđƒāļŦāđ‰āļāļąāļšāļ„āđˆāļēāļ•āļąāļ§āđāļ›āļĢ āļāđˆāļ­āļ™āļ—āļĩāđˆāļˆāļ°āļĄāļĩāļāļēāļĢ Input āļĨāļ‡āđƒāļ™ Statement āđāļĨāļ°āļ—āļąāđ‰āļ‡āļĒāļąāļ‡āļŠāļēāļĄāļēāļĢāļ–āļĨāļ”āļ›āļąāļāļŦāļēāļāļēāļĢāđāļšāđˆāļ‡āđāļĒāļāļĢāļ°āļŦāļ§āđˆāļēāļ‡āļ„āđˆāļē Argument āļ‚āļ­āļ‡āđāļ•āđˆāļĨāđˆāļ° Statement āđ€āļŠāđˆāļ™ Values ('1','I don't no')

Parameter Syntax
Dim QueryString As String = "SELECT * FROM Table1 WHERE Field1 LIKE @p1"
Dim Cmd As OleDbCommand = New OleDbCommand(QueryString, Connection)
Cmd.Parameters.Add("@p1", OleDbType.Char, 3).Value = "a"


āļŠāļģāļŦāļĢāļąāļšāđƒāļ™āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļœāļĄāđ„āļ”āđ‰āļ­āļ­āļāđāļšāļšāđ„āļ§āđ‰āļŠāļģāļŦāļĢāļąāļš NameSpace 5 āļ•āļąāļ§āļ„āļĢāļąāļš


1.System.Data.OleDb - Parameter Query(OleDbParameter)
strSQL = "INSERT INTO customer (CustomerID,Name,Email,CountryCode,Budget,Used) " & _
"VALUES (@sCustomerID,@sName,@sEmail,@sCountryCode,@sBudget,@sUsed)"

objCmd = New System.Data.OleDb.OleDbCommand(strSQL,objConn)

With objCmd
.Parameters.Add(New OleDbParameter("@sCustomerID","C005"))
.Parameters.Add(New OleDbParameter("@sName","Weerachai Nukitram"))
.Parameters.Add(New OleDbParameter("@sEmail","[email protected]"))
.Parameters.Add(New OleDbParameter("@sCountryCode","TH"))
.Parameters.Add(New OleDbParameter("@sBudget","2000000"))
.Parameters.Add(New OleDbParameter("@sUsed","1000000"))
End With



2.MySql.Data.MySQLClient - Parameter Query (MySQLParameter)
strSQL = "INSERT INTO customer (CustomerID,Name,Email,CountryCode,Budget,Used) " & _
"VALUES (?sCustomerID,?sName,?sEmail,?sCountryCode,?sBudget,?sUsed)"

objCmd = New MySql.Data.MySQLClient.MySQLCommand(strSQL,objConn)

With objCmd
.Parameters.Add(new MySQLParameter("?sCustomerID", "C005"))
.Parameters.Add(new MySQLParameter("?sName", "Weerachai Nukitram"))
.Parameters.Add(new MySQLParameter("?sEmail", "[email protected]"))
.Parameters.Add(new MySQLParameter("?sCountryCode", "TH"))
.Parameters.Add(new MySQLParameter("?sBudget", "2000000"))
.Parameters.Add(new MySQLParameter("?sUsed", "100000"))
End With


3.System.Data.SqlClient - Parameter Query (SqlParameter)
strSQL = "INSERT INTO customer (CustomerID,Name,Email,CountryCode,Budget,Used) " & _
"VALUES (@sCustomerID,@sName,@sEmail,@sCountryCode,@sBudget,@sUsed)"

objCmd = New System.Data.SqlClient.SqlCommand(strSQL,objConn)

With objCmd
.Parameters.Add(New SqlParameter("@sCustomerID","C005"))
.Parameters.Add(New SqlParameter("@sName","Weerachai Nukitram"))
.Parameters.Add(New SqlParameter("@sEmail","[email protected]"))
.Parameters.Add(New SqlParameter("@sCountryCode","TH"))
.Parameters.Add(New SqlParameter("@sBudget","2000000"))
.Parameters.Add(New SqlParameter("@sUsed","1000000"))
End With



4.System.Data.OracleClient - Parameter Query (OracleParameter)
strSQL = "INSERT INTO customer (CustomerID,Name,Email,CountryCode,Budget,Used) " & _
"VALUES (:sCustomerID,:sName,:sEmail,:sCountryCode,:sBudget,:sUsed)"

objCmd = New System.Data.OracleClient.OracleCommand(strSQL,objConn)
With objCmd
.Parameters.Add(new OracleParameter(":sCustomerID", "C005"))
.Parameters.Add(new OracleParameter(":sName", "Weerachai Nukitram"))
.Parameters.Add(new OracleParameter(":sEmail", "[email protected]"))
.Parameters.Add(new OracleParameter(":sCountryCode", "TH"))
.Parameters.Add(new OracleParameter(":sBudget", "2000000"))
.Parameters.Add(new OracleParameter(":sUsed", "100000"))
End With



5.System.Data.Odbc - Parameter Query (OdbcParameter)
strSQL = "INSERT INTO customer (CustomerID,Name,Email,CountryCode,Budget,Used) " & _
"VALUES (?,?,?,?,?,?)"

objCmd = New System.Data.Odbc.OdbcCommand(strSQL,objConn)
With objCmd
.Parameters.Add(New OdbcParameter("@sCustomerID","C005"))
.Parameters.Add(New OdbcParameter("@sName","Weerachai Nukitram"))
.Parameters.Add(New OdbcParameter("@sEmail","[email protected]"))
.Parameters.Add(New OdbcParameter("@sCountryCode","TH"))
.Parameters.Add(New OdbcParameter("@sBudget","2000000"))
.Parameters.Add(New OdbcParameter("@sUsed","1000000"))
End With



Transaction()









āļšāļ—āļ„āļ§āļēāļĄāļ­āļ·āđˆāļ™ āđ† āđ€āļāļĩāđˆāļĒāļ§āļāļąāļšāļāļēāļĢ āļāļēāļĢāđƒāļŠāđ‰ Parameter Query
Go to : ASP.NET Access BLOB Binary Data and Parameterized Query
Go to : ASP.NET MySQL BLOB Binary Data and Parameterized Query
Go to : ASP.NET SQL Server BLOB Binary Data and Parameterized Query
Go to : ASP.NET Oracle BLOB Binary Data and Parameterized Query


       
Bookmark.   
       

 

  By : TC Admin
  Score Rating : -
  Create Date : 2009-01-15 00:05:27
  Download : No files
     

Clound SSD Virtual Server
-->
Related Links
ASP.NET āđ€āļĢāļĩāļĒāļ PHP āļāļąāļšāļāļēāļ™āļ‚āđ‰āļ­āļĄāļđāļĨ MySQL āļœāđˆāļēāļ™ Web Service āđāļĨāļ°āļāļēāļĢāļĢāļąāļšāļŠāđˆāļ‡āļ„āđˆāļēāļœāđˆāļēāļ™āđ€āļ§āđ‡āļšāđ€āļ‹āļ­āļĢāđŒāļ§āļīāļŠ
ASP.NET āđ€āļĢāļĩāļĒāļ PHP āļāļąāļšāļāļēāļ™āļ‚āđ‰āļ­āļĄāļđāļĨ MySQL āļœāđˆāļēāļ™ Web Service āđāļĨāļ°āļāļēāļĢāļĢāļąāļšāļŠāđˆāļ‡āļ„āđˆāļēāļœāđˆāļēāļ™āđ€āļ§āđ‡āļšāđ€āļ‹āļ­āļĢāđŒāļ§āļīāļŠ
āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡āđ€āļ§āđ‡āļšāđ€āļ‹āļ­āļĢāđŒāļ§āļīāļŠāļ”āđ‰āļ§āļĒ php āļāļąāļšāļāļēāļ™āļ‚āđ‰āļ­āļĄāļđāļĨ mysql āđāļĨāļ°āļ—āļģāļāļēāļĢāđ€āļĢāļĩāļĒāļ web service āļ”āđ‰āļ§āļĒ asp.net āļ‹āļķāđˆāļ‡āļ­āļĒāļđāđˆāđƒāļ™āļāļąāđˆāļ‡ client āđ‚āļ”āļĒāļ—āļģāļāļēāļĢāļĢāļąāļšāļŠāđˆāļ‡āļ‚āđ‰āļ­āļĄāļđāļĨāļĢāļ°āļŦāļ§āđˆāļēāļ‡ php āļāļąāļš asp.net
Rating :
Update :
2017-03-17 21:21:37 View : 17,355
āļŠāļĢāđ‰āļēāļ‡ Sub Report (Subreport) āļšāļ™ Crystal Report āđāļšāļš Step by Step (VB.NET /C#)
āļŠāļĢāđ‰āļēāļ‡ Sub Report (Subreport) āļšāļ™ Crystal Report āđāļšāļš Step by Step (VB.NET /C#)
āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡ Sub Report āļšāļ™ Crystal Report āđāļĨāļ°āļāļēāļĢ Link āļ‚āđ‰āļ­āļĄāļđāļĨāļĢāļ°āļŦāļ§āđˆāļēāļ‡ Main Report āļāļąāļš Sub Report āļĢāļ§āļĄāļ—āļąāđ‰āļ‡āļāļēāļĢ Set DataSource āđƒāļŦāđ‰āļāļąāļš Sub Report
Rating :
Update :
2017-03-24 21:34:46 View : 54,806
Generating Excel Report in .NET Framework
Generating Excel Report in .NET Framework
āļŠāļĢāđ‰āļēāļ‡āđ„āļŸāļĨāđŒāđ€āļ­āļāļŠāļēāļĢ Excel āļšāļ™ Windows Application āđāļĨāļ° Console Application āļ”āđ‰āļ§āļĒ Framework
Rating :
Update :
2017-03-24 21:16:47 View : 9,881
.NET Framework āļĢāļ§āļšāļĢāļ§āļĄāđ€āļ—āļ„āļ™āļīāļ„āļāļēāļĢāļžāļąāļ’āļ™āļēāđ‚āļ›āļĢāđāļāļĢāļĄāļ”āđ‰āļ§āļĒ .NET āļ—āļąāđ‰āļ‡ VB.NET āđāļĨāļ° C#
.NET Framework āļĢāļ§āļšāļĢāļ§āļĄāđ€āļ—āļ„āļ™āļīāļ„āļāļēāļĢāļžāļąāļ’āļ™āļēāđ‚āļ›āļĢāđāļāļĢāļĄāļ”āđ‰āļ§āļĒ .NET āļ—āļąāđ‰āļ‡ VB.NET āđāļĨāļ° C#
āļŦāļąāļ§āļ‚āđ‰āļ­āļ™āļĩāđ‰āļœāļĄāđ„āļ”āđ‰āļĢāļ§āļšāļĢāļĄāđ€āļ—āļ„āļ™āļīāļ„āļ•āđˆāļēāļ‡ āđ† āļ—āļĩāđˆāđ€āļāļĩāđˆāļĒāļ§āļ‚āđ‰āļ­āļ‡āļāļąāļšāļāļēāļĢāļžāļąāļ’āļ™āļēāđ‚āļ›āļĢāđāļāļĢāļĄāļ”āđ‰āļ§āļĒ .NET Framework āļ„āļĢāļšāļ„āļĨāļļāļĄāļ—āļąāđ‰āļ‡ Framework 1,2,3 āđāļĨāļ°āļ āļēāļĐāļē VB.NET,C#
Rating :
Update :
2017-03-24 21:23:16 View : 15,529
āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡ Crystal Report āļāļąāļšāļāļēāļĢāļŠāļĢāđ‰āļēāļ‡ Class āđāļĨāļ° DataSource (.NET)
āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡ Crystal Report āļāļąāļšāļāļēāļĢāļŠāļĢāđ‰āļēāļ‡ Class āđāļĨāļ° DataSource (.NET)
āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡ class āļšāļ™ .net framework āđ€āļžāļ·āđˆāļ­āļŠāļĢāđ‰āļēāļ‡ dataset āđāļĨāļ° datatable āļāļģāļŦāļ™āļ”āļ„āđˆāļē datasource āđƒāļŦāđ‰āļāļąāļš crystal report
Rating :
Update :
2017-03-24 21:32:24 View : 22,276
Install .NET Framework 1.1 & Visual Studio .NET 2003
Install .NET Framework 1.1 & Visual Studio .NET 2003
Install .NET Framework 1.1 & Visual Studio .NET 2003 āļ•āļīāļ”āļ•āļąāđ‰āļ‡āđāļĨāļ°āđƒāļŠāđ‰āļ‡āļēāļ™ .NET Framework 1.1 āđāļĨāļ° VS 2003
Rating :
Update :
2009-01-11 09:41:25 View : 7,033
ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

āļŠāļ­āļ™ PHP āļœāđˆāļēāļ™ Youtube āļŸāļĢāļĩ
āļŠāļ­āļ™ Android āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ Android
āļŠāļ­āļ™ Windows Phone āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ Windows Phone 7 āđāļĨāļ° 8
āļŠāļ­āļ™ iOS āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ iPhone, iPad
āļŠāļ­āļ™ Java āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āļ āļēāļĐāļē Java
āļŠāļ­āļ™ Java GUI āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āļ āļēāļĐāļē Java GUI
āļŠāļ­āļ™ JSP āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āļ āļēāļĐāļē Java
āļŠāļ­āļ™ jQuery āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āļ āļēāļĐāļē jQuery
āļŠāļ­āļ™ .Net āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āļ āļēāļĐāļē .Net
Free Tutorial
āļŠāļ­āļ™ Google Maps Api
āļŠāļ­āļ™ Windows Service
āļŠāļ­āļ™ Entity Framework
āļŠāļ­āļ™ Android
āļŠāļ­āļ™ Java āđ€āļ‚āļĩāļĒāļ™ Java
Java GUI Swing
āļŠāļ­āļ™ JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
āļŠāļ­āļ™ jQuery
āļŠāļ­āļ™ jQuery āļāļąāļš Ajax
āļŠāļ­āļ™ PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
āļŠāļ­āļ™ SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
āđāļ™āļ§āļ—āļēāļ‡āļāļēāļĢāļ—āļģ SEO
āļ›āļĢāļąāļšāđāļ•āđˆāļ‡āđ€āļ§āđ‡āļšāđƒāļŦāđ‰āđ‚āļŦāļĨāļ”āđ€āļĢāđ‡āļ§


Hit Link
   







Load balance : Server 01
Inline