C
chessitguy
my stored procedure:
create procedure ps_title @Title nchar(15)
AS
SELECT
,Title
FROM books
Where Title = @Title
this is my code. i'm passing variable to sp and getting no results.
protected void Button1_Click(object sender, EventArgs e)
{
SqlDataReader rdr = null;
SqlConnection con = null;
SqlCommand cmd = null;
try
{
string conn =
@"server=local;uid=;pwd=;trusted_connection=true;database=library";
con = new SqlConnection(conn);
con.Open();
cmd = new SqlCommand("ps_title", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Book",
System.Data.SqlDbType.NVarChar).Value = drpdbooks.Text;
// Execute the query
rdr = cmd.ExecuteReader();
}
}
create procedure ps_title @Title nchar(15)
AS
SELECT
,Title
FROM books
Where Title = @Title
this is my code. i'm passing variable to sp and getting no results.
protected void Button1_Click(object sender, EventArgs e)
{
SqlDataReader rdr = null;
SqlConnection con = null;
SqlCommand cmd = null;
try
{
string conn =
@"server=local;uid=;pwd=;trusted_connection=true;database=library";
con = new SqlConnection(conn);
con.Open();
cmd = new SqlCommand("ps_title", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Book",
System.Data.SqlDbType.NVarChar).Value = drpdbooks.Text;
// Execute the query
rdr = cmd.ExecuteReader();
}
}