Forum
23:33
23/05/2012
hi everyone, i'm recently discover this plugin, and i would like to use it on a application that i'm currently developing, but i don't know how to populate the grid, using data, that i'm extracting from my db2 as400 database, using oledb.
i can create a type Json with the sql query from my database, but i don't know how to use for populate my grid, and how to obtain the rest of the data like rows, pages, records
anyone can help me?
thanks!!!
some of my code:
public ActionResult UpdateProductoA(string words, string clave1,
string clave2)
{
List<Detalle> mySource = miConexion.DatosProductoA(username, password, words, clave1, clave2);
List<string> retornar = new List<string>();
foreach (var item in mySource)
{
retornar.Add(item.nombreArticulo);
retornar.Add(item.unidadMedida);
}
return Json(retornar);
}
#region DatosProductoA() Actualiza valores en EntradaPedidosDetalle bajo ciertos parametros
public List<Detalle> DatosProductoA(string username, string password,
string words, string clave1, string clave2)
{
List<Detalle> datosProducto = new List<Detalle>();
try
{
OleDbConnection conexion = new OleDbConnection
(@"Provider=IBMDA400.DataSource.1;
Data Source=neptuno;
Persist Security Info=True;
Password=" + password + @";
User ID=" + username +
@";Default Collection=tesdatos");
OleDbCommand comandoSelect = new OleDbCommand(@"SELECT ZSUPDS AS NOMART, XCDUMS AS UNIDAD
FROM TESDATOS.ARTMS21L
LEFT JOIN TESDATOS.ARTNM01L ON ZRECTY=XRECTY AND ZCDKE1=XCDKE1
WHERE ZRECTY =('" + words.ToString() + @"')
AND ZCDKE1 =('" + clave1.ToString() + @"')
AND ZCDKE2 =('" + clave2.ToString() + @"')", conexion);
comandoSelect.Connection = conexion;
conexion.Open();
comandoSelect.ExecuteNonQuery();
OleDbDataReader resultado = comandoSelect.ExecuteReader();
while (resultado.Read())
{
Detalle misDatos = new Detalle();
misDatos.nombreArticulo = resultado.GetString(0);
misDatos.unidadMedida = resultado.GetString(1);
datosProducto.Add(misDatos);
}
conexion.Close();
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
return datosProducto;
}
#endregion
Most Users Ever Online: 715
Currently Online:
26 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66