18 Dic

Repeater desde sql con c#

Como usar un repeater en c#

static public void obtenerenrepeater(string cadena, Repeater repetidor)
SqlConnection con = new SqlConnection("Data Source=--base de datos--;Initial Catalog=testSQL;Integrated Security=True");
string sSQL = cadena;
SqlCommand cmd = new SqlCommand(sSQL, con);
con.Open();
SqlDataReader dtrClient = cmd.ExecuteReader();
repetidor.DataSource = dtrClient;
repetidor.DataBind();
con.Close();
}
Share this

Leave a reply