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.

CSHARP command parameter concepts

<%@ 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);
%>

Thanks for Your Visit

Google Search
Disclaimer and Copy Right