checking password

i used this code to retrieve customer_ID from a database given a userid and password
how to retrieve the customer_ID
my code:
public static int CheckPassword(string userid,string pass)
{

SqlConnection conn=new SqlConnection(ConfigurationSettings.AppSettings["connString"]);
String strCheckPassword=@"Select Customer_ID from Customers Where UserID='" +userid+ "' "+"AND Password='"+pass+"'";
//name of the stored proceedure and command type set to StoredProceedure
SqlDataAdapter adp=new SqlDataAdapter(strCheckPassword,conn);
DataSet ds=new DataSet();
conn.Open();
adp.Fill(ds);
result=//this must retrieve customer_id from dataset ds; //help here

conn.Close();
return result;
}

[754 byte] By [connect2sandeep] at [2008-2-8]
# 1
solved using Datareder get- method;
connect2sandeep at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Data Access...

SQL Server

Site Classified