Click here to Skip to main content
15,923,376 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey i want to filter my datagrid so i have put done a query in the fill with the following
SQL
SELECT        id, cardNumber, transactionType, transactionAmount, transactionDate
FROM            [Log]
WHERE        (cardNumber = @cardNumber) AND (transactionDate = GETDATE() - 7)

this is the code i am using then


C#
Show2 show2 = new Show2();

        public Form3()
        {
            InitializeComponent();
        }


        private void Form3_Load(object sender, EventArgs e)
        {
            logTableAdapter1.Fill(boGDataSet1.Log, show2.cardNumber.ToString());
        }




This is not working as when i load the form it give me a blank datagrid and am not sure what i am doing wrong
Posted
Updated 14-Mar-12 5:53am
v2
Comments
Herman<T>.Instance 14-Mar-12 11:53am    
is this winforms or asp.net or...?
Herman<T>.Instance 14-Mar-12 11:54am    
what kind of object is logTableAdapter1?
stefanere2k9 14-Mar-12 11:56am    
winforms and logtableadapter1 is a dataadapter which contains the table
Herman<T>.Instance 14-Mar-12 11:57am    
how is that adapter attached to the datagridview? Can you show that code too?
Sergey Alexandrovich Kryukov 14-Mar-12 12:01pm    
Can you check up what this query returns without filling adapters, etc? Using data reader?
How do you know there is actual data?
--SA

1 solution

more hints and tips about DataGridView can be found here[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900