I input username & i wanted to get all details as output.First i show you in php code,
$strSQLUSER="SELECT * FROM User WHERE username='".addslashes($MessageArray[0])."' AND state!='1' AND state!='4'";
$result_user=odbc_exec($conn,$strSQLUSER) or die("Could not connect to database");
$huntername = stripslashes(odbc_result($result_user,"name"));
$huntlicense = stripslashes(odbc_result($result_user,"license"));
Then i use my .net coding for that.here is the part of the coding.
private void MooseSeenInput(string MobileNo, string Date, string odd, params Array[] msg_arr)
{
controller = new UnitsController();
DataSet ds = controller.GetUserDetails(username);
if (ds.Tables[0].Rows.Count > 0)
{
//get username & License
string user=ds.Tables[0].Rows[0]["name"].ToString();
string license= ds.Tables[0].Rows[0]["license"].ToString();
}
Then i wrote Stored Procedure for this… but i’m unfit for this procedure,
ALTER PROCEDURE dbo.
@UserName varchar(50),
@License varchar(50) OUTPUT
AS
BEGIN
Select * FROM
Users
Where UserName = @UserName & State ='1' & State= '4'
END
–exec GetSMSUserDetails_SP
Additionally here i have added sqldataprovider part
public override DataSet GetSMSUserDetails(string UserName)
{
return SqlHelper.ExecuteDataset(ViltraConnectionString, GetFullyQualifiedName("GetSMSUserDetails_SP"),UserName);
}
#endregion SMS
Use
Andinstead of&for string concat in sql server.Remove
Out Parameterfrom SP because you are returning records.SP with Output param.