Pues basicamente es asi como loe srtoy haciendo
Código ASP:
Ver originalusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Telerik.Web.UI;
using System.Web.UI;
using System.Web.UI.WebControls;
/// <summary>
/// Descripción breve de Funciones
/// </summary>
public class Funciones
{
public static string StringConnection = ConfigurationManager.ConnectionStrings["conexion"].ConnectionString;
public Funciones()
{
//
// TODO: Agregar aquí la lógica del constructor
//
}
public static DataTable GetData(string QueryString)
{
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(QueryString, StringConnection);
da.Fill(dt);
return dt;
}
public void FillCombos(RadComboBox Combo, DataTable dt, string TexField, string ValueField)
{
Combo.DataSource = dt;
Combo.DataTextField = TexField;
Combo.DataValueField = ValueField;
}
public void FillCheck( CheckBoxList CheckBoxList,DataTable dt, string TexField, string ValueField)
{
CheckBoxList.DataSource = dt;
CheckBoxList.DataTextField = TexField;
CheckBoxList.DataValueField = ValueField;
}
}