Have a 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 loads some address information.
However, in this xtragridview table, you have addresses of several other clients, so you would need it to only bring the addresses of that client.
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
That's where my question comes from, how do I define this parameter @id_cliente
?
If it were a normal query, it would look like this:
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 do it?
Valeuu