@{ string texto = ""; string sucursal = Session["sucursal"].ToString(); var db = WebMatrix.Data.Database.Open("cweb"); try { texto = Request.QueryString["s"].ToString(); } catch (Exception ex) { texto = ""; } var sSQL = ""; if (texto != "" && texto != "*") { sSQL = "SELECT * FROM clientes WHERE sucursal = '" + sucursal + "' AND (nombre LIKE '%" + texto + "%' OR correo LIKE '%" + texto + "%' OR rfc LIKE '%" + texto + "%') "; db.QuerySingle(sSQL); } else if (texto == "*") { sSQL = "SELECT * FROM clientes WHERE sucursal = '" + sucursal + "'"; db.QuerySingle(sSQL); } }

account_circle CLIENTES

@{ try { foreach (var row in db.Query(sSQL)) { } } catch (Exception ex) { string nada = ""; } db.Connection.Close(); db.Close(); db.Dispose(); }
CLAVE NOMBRE RFC CALLE TELEFONO COLONIA CORREO
@row.clave @row.nombre @row.rfc @row.calle @row.exterior @row.interior @row.tel1 @row.colonia @row.correo