ASP.NET: How to Load image and save to database form clientside


ok so i’ve select some stuff and i’ve got a row (etc select id, username from user). this is done within a stored procedure. i’ve declare 2 variables @id and @username and  i wish to store both the Id and UserName into 2 variables. what may be the best
way to do it? (i was thinking of creating a temporary table and set @id = select id from temp; set @username=select username from temp; but it looks like a bad way to do it i think

You can populate the variables  with the select  statementselect @ID = ID, @UserName = UserName from Users WHERE SomeCondition returning one record onlyIf you want to get results of a stored  procedure into variables, then you’d need a table  and insert the SP result into this table using INSERT EXECUTE statement, then get the values  with the select I showed.Premature optimization is the root of all evil in programming. (c) by Donald Knuth

There is not a “good” way to get the results of a select  statement returned from a stored  proc into variables. The simplest way is: CREATE TABLE #tmptbl (id int,username varchar(50))INSERT INTO #tmptblEXEC storedprocSELECT TOP 1 @id  = id, @username  = username  FROM #tmptblDROP TABLE #tmptbl