Carrega o SqlDataSource via código
protected string retornaValor(object operacao)
{
string voperacao = operacao.ToString();
string codigo = Session["codigo"].ToString();
SqlDataSource2.DataSourceMode = SqlDataSourceMode.DataReader;
SqlDataSource2.ConnectionString = "Data Source=localhost;Initial Catalog=database;User ID=user;Password=pws";
SqlDataSource2.SelectCommand = "SP_MENU_SUBOPERACAO";
SqlDataSource2.SelectCommandType = SqlDataSourceCommandType.StoredProcedure;
SqlDataSource2.SelectParameters.Add("OPERACAO", voperacao);
SqlDataSource2.SelectParameters.Add("CODIGO", codigo);
SqlDataSource2.SelectParameters.Add("PK_IDSISTEMAS", Request.QueryString["id"]);
SqlDataSource2.Select(DataSourceSelectArguments.Empty);
return "";
}
{
string voperacao = operacao.ToString();
string codigo = Session["codigo"].ToString();
SqlDataSource2.DataSourceMode = SqlDataSourceMode.DataReader;
SqlDataSource2.ConnectionString = "Data Source=localhost;Initial Catalog=database;User ID=user;Password=pws";
SqlDataSource2.SelectCommand = "SP_MENU_SUBOPERACAO";
SqlDataSource2.SelectCommandType = SqlDataSourceCommandType.StoredProcedure;
SqlDataSource2.SelectParameters.Add("OPERACAO", voperacao);
SqlDataSource2.SelectParameters.Add("CODIGO", codigo);
SqlDataSource2.SelectParameters.Add("PK_IDSISTEMAS", Request.QueryString["id"]);
SqlDataSource2.Select(DataSourceSelectArguments.Empty);
return "";
}
Comentários
Postar um comentário
Os códigos postados aqui são uma seqüência de instruções de forma ordenada, não compilada para o código de máquina, em uma determinada linguagem de programação.
Ajude a melhorar esses códigos.