Guys,
I'm having a problem trying to populate datatable in dataset with output parameters that return by sql proc.
No errors, just dataset have no tables...
sql proc:
create procedure p_temp
@CODE varchar(4),
@FIRST_NAME varchar (20) output
as
select @FIRST_NAME = 'myName'
c#:
........
SqlDataAdapter oDA = new SqlDataAdapter();
DataSet oDS = new DataSet("INFO");
SqlCommand oCmd = new SqlCommand("p_temp", oConn);
oCmd.CommandType = CommandType.StoredProcedure;
oCmd.Parameters.Add("@CODE", SqlDbType.VarChar, 4, "CODE");
oCmd.Parameters["@CODE"].Value = "1234";
SqlParameter paramOutput = oCmd.Parameters.Add("@FIRST_NAME", SqlDbType.VarChar, 20, "");
paramOutput.Direction = ParameterDirection.Output;
oDA.SelectCommand = oCmd;
oDA.Fill(oDS);
...........
I'm having a problem trying to populate datatable in dataset with output parameters that return by sql proc.
No errors, just dataset have no tables...
sql proc:
create procedure p_temp
@CODE varchar(4),
@FIRST_NAME varchar (20) output
as
select @FIRST_NAME = 'myName'
c#:
........
SqlDataAdapter oDA = new SqlDataAdapter();
DataSet oDS = new DataSet("INFO");
SqlCommand oCmd = new SqlCommand("p_temp", oConn);
oCmd.CommandType = CommandType.StoredProcedure;
oCmd.Parameters.Add("@CODE", SqlDbType.VarChar, 4, "CODE");
oCmd.Parameters["@CODE"].Value = "1234";
SqlParameter paramOutput = oCmd.Parameters.Add("@FIRST_NAME", SqlDbType.VarChar, 20, "");
paramOutput.Direction = ParameterDirection.Output;
oDA.SelectCommand = oCmd;
oDA.Fill(oDS);
...........