0
Everybody good night, how are you?
I’m creating a user registration screen, where every user has an ID, on this screen, I have an xtragridview, which carries some address information.
However, in this xtragridview table, it has addresses of several other customers, so it only needed to bring the addresses of that customer.
I’m trying to create a query, in the gridview datasource:
select "Cliente_enderecos_alter"."id_cliente_cobranca",
"Cliente_enderecos_alter"."endereco",
"Cliente_enderecos_alter"."numero",
"Cliente_enderecos_alter"."bairro",
"Cliente_enderecos_alter"."cidade",
"Cliente_enderecos_alter"."estado",
"Cliente_enderecos_alter"."cep"
from "dbo"."Cliente_enderecos_alter" "Cliente_enderecos_alter"
where "Cliente_enderecos_alter"."id_cliente" = @id_cliente
Here comes my doubt, as I define this parameter @id_cliente
?
If it were a normal consultation, I would do so:
consql._sql = @"SELECT * FROM Login WHERE id_usu = @id_usu";
SqlCommand cmd = new SqlCommand(consql._sql, sqlconn);
cmd.Parameters.Add("@id_usu", SqlDbType.Int).Value = id_usu;
sqlconn.Open();
But in gridview? how do I???
Valeuu