<%@ Page Language="C#" Debug="true"%> <%@ Import Namespace="System.Data.OleDb" %> <% string sConn; sConn= @"Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:/emp.mdb"; string sql=@"select [name] from emp where EmpID=@EmpID"; string empName; int sEmpId=25; OleDbConnection conn=new OleDbConnection(sConn); OleDbCommand cmd=new OleDbCommand(sql,conn); cmd.Parameters.Add("@EmpID",OleDbType.Integer); cmd.Parameters["@EmpID"].Value=sEmpId; conn.Open(); empName=cmd.ExecuteScalar().ToString(); conn.Close(); Response.Write(empName); %> |
The things I learnt while I migrated from classic asp to asp.net is given here for my reference as well as for new beginners.
INDEX
-
▼
2009
(17)
-
▼
January
(17)
- The Very First Video Tutorial for ASP.NET C#
- Your First Csharp Code
- PHONE BOOK PROGRAM CODE IN ASP.NET CSHARP
- SINGLE DIMENTIONAL ARRAY C#
- TWO DIMENTIONAL ARRAY C# CODE
- ASP.NET CODING FOR REPEATER CONTROL
- ASP.NET-CSHARP-XML-AS-DATABASE
- LISTBOX LESSON 2 HOW TO MOVE DATA FROM LISTBOX TO ...
- ASP.NET-CSHARP-DROPDOWNLIST-EDIT FORM-SOURCE CODE
- What is AuotEventWireup and how to use it
- How to Create HyperLink in a Data Grid
- Login Form - Code in ASP.NET Csharp
- What is ADO.NET | Data Provider | DataSet
- CSHARP command parameter concepts
- Why @ symbol is used in string
- ExecuteScalar ExecuteReader ExecuteNonQuery : What...
- HASH TABLE VS SCRIPTING DICTIONARY
-
▼
January
(17)
CSHARP command parameter concepts
Related Links
Thanks for Your Visit
|
||
| ||
Disclaimer and Copy Right |