dbcon.con.Open(); cmd = new OdbcCommand("{call proc_verify(?)}", dbcon.con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("uname", Login1.UserName); reader = cmd.ExecuteReader();
cmd = New SqlCommand sCmdText = "select dbo." & funcName & "(" cmd.CommandType = CommandType.Text cmd.Connection = _sqlConn cmd.CommandTimeout = 0
SqlConnection con = new SqlConnection(connectionString);SqlCommand com = new SqlCommand("Execute dbo.Funcname", con);return (Boolean)com.ExecuteScalar();
protected void Page_Load(object sender,eventargs e){reportViewer1.LocalReport.ReportEmbeddedResource = "ReportsApplication1.Report1.rdlc";string strQuery = "select databasename.dbo.udf_GetDetailCredentialReport";SqlCommand sqlCmd = new SqlCommand(strQuery, conReport); conReport.Open(); drReport1= sqlCmd.ExecuteReader(); string retString="";while (dataReport1.Read()) { retString += dataReport1[0].ToString(); } dataReport1.Close(); conReport.Dispose(); conReport.Close();
SqlConnection con = new SqlConnection(connectionString);SqlCommand cmd = new SqlCommand("dbo.udf_GetDetailCredentialReport", con);return (Boolean)cmd.ExecuteScalar();
Imports System.Data.SqlClientImports System.DataPartial Class _Default Inherits System.Web.UI.Page Dim con As SqlConnection Dim cmd As SqlCommand Dim strusername As String = String.Empty Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged con = New SqlConnection(("server=ServerName;database=DataBaseName;uid=userid;pwd=password;")) cmd = New SqlCommand("select count(*) from Tablename where Username='" & TextBox1.Text & "'", con) con.Open() strusername = cmd.ExecuteScalar con.Close() If strusername <> "0" Then MsgBox("UserName Already Exists") ' Response.Redirect("Default2.aspx") End If End SubEnd Class
Thanks & RegardsG.RenganathanNothing is mine ,Everything is yours!!!