Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/06/2011, 15:23
acse
 
Fecha de Ingreso: agosto-2010
Ubicación: mexico
Mensajes: 125
Antigüedad: 13 años, 8 meses
Puntos: 0
Pregunta Respuesta: descripcion de codigo C#.NET

Hola

Hice esta fragmento de cofigo pero al momento de hacer el filtro no me mustra nada en el datagridvieW

Código PHP:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace CobXKAMEX
{
    public 
partial class Form1 Form
    
{

        
        private 
SqlDataAdapter sqlDataAdapter1;
        private 
DataSet ds;


        public 
Form1()
        {
            
InitializeComponent();
        }

        private 
void btBuscar_Click(object senderEventArgs e)
        {

            try
            {
                
string conexion "Data Source=5.244.194.132\\PUNTADELCIELO,1433;Initial Catalog=2010SW;User ID=EuroWin;Password=ew#211218";

                
SqlConnection cnn = new SqlConnection(conexion);


              
SqlCommand cmd = new SqlCommand("select cuenta from asientos where cuenta = @cuenta "cnn);

               
cmd.Parameters.Add("@cuenta"SqlDbType.VarChar).Value txtcuenta.Text ;
               
                
cnn.Open();

                
sqlDataAdapter1 = new SqlDataAdapter ();

                
sqlDataAdapter1.Fill(ds);

                
ds = new DataSet();

                
dataGridView1.DataSource ds.Tables["asientos"];

                
dataGridView1.Columns["cuenta"].HeaderText "cuenta";

            }
            catch (
Exception)
            {

                
MessageBox.Show("jajajaja");
            }
            
finally
            
{
                
Close();
            }
            
        }

        
    }


Última edición por acse; 22/06/2011 a las 15:30 Razón: me falto editar