+ 1

about c# windows form and DataGridView

i have a datagridview in c# windows form . when i use SELECT * FROM table_name WHERE column_name IS NOT NULL datagridview don't return for me null rows . what should i do ? i am sorry for my bad enghlish.

16th May 2017, 3:02 PM
Ramin Bagherian
Ramin Bagherian - avatar
19 Answers
+ 4
make solo learn a chatting community 😄😄😄
5th Jun 2017, 6:05 AM
m8riix
m8riix - avatar
+ 3
ok
28th May 2017, 9:31 AM
Shanta Soren
Shanta Soren - avatar
+ 2
not bad is good English ok
28th May 2017, 7:56 AM
Shanta Soren
Shanta Soren - avatar
+ 2
ok bye
28th May 2017, 8:46 AM
Shanta Soren
Shanta Soren - avatar
+ 2
hiii
4th Jun 2017, 6:39 PM
Shanta Soren
Shanta Soren - avatar
+ 1
u r asking SQL to return rows which don't have NULL for column_name, so it doesn't return rows which have NULL for mentioned column. Wht u tring to query?
16th May 2017, 3:41 PM
Eranga
Eranga - avatar
+ 1
welkam
28th May 2017, 8:01 AM
Shanta Soren
Shanta Soren - avatar
+ 1
hii your Indian ya no
28th May 2017, 9:00 AM
Shanta Soren
Shanta Soren - avatar
+ 1
😂😂😂
5th Jun 2017, 6:11 AM
Ramin Bagherian
Ramin Bagherian - avatar
+ 1
kya
9th Jun 2017, 11:57 AM
Shanta Soren
Shanta Soren - avatar
0
this is my code private void Form2_Load(object sender, EventArgs e) Connection.ConnectionString = @"connection Path"; Connection.Open(); Command.Connection = Connection; Command.CommandText = "select Number , Name , Services from tbleOwner Where Name is null"; DataAdapter.SelectCommand = Command; DataAdapter.Fill(Data , " O2"); Command.ExecuteNonQuery(); dataGridView.DataBindings.Clear(); dataGridView.DataBindings.Add("datasource" , Data , "O2"); but datagridview return for me all of data ! Where is my mistake ?
16th May 2017, 4:55 PM
Ramin Bagherian
Ramin Bagherian - avatar
0
First try the same query in SQL, if u r not getting expected result it probably something to do with ur table​ otherwise it's code error.
16th May 2017, 5:28 PM
Eranga
Eranga - avatar
0
I have tried many ways in sql but the result has not changed. I guess the problem is dataGridView.
16th May 2017, 5:45 PM
Ramin Bagherian
Ramin Bagherian - avatar
0
if SQL provide expected result it's an code error. hope this helps: https://msdn.microsoft.com/en-us/library/fbk67b6z(v=vs.110).aspx
16th May 2017, 5:50 PM
Eranga
Eranga - avatar
0
yes
26th May 2017, 2:33 PM
Shanta Soren
Shanta Soren - avatar
0
thank you ☺
28th May 2017, 7:59 AM
Ramin Bagherian
Ramin Bagherian - avatar
0
bye 😊
28th May 2017, 8:51 AM
Ramin Bagherian
Ramin Bagherian - avatar
0
no I'm from iran !
28th May 2017, 9:16 AM
Ramin Bagherian
Ramin Bagherian - avatar
0
😐
4th Jun 2017, 6:57 PM
Ramin Bagherian
Ramin Bagherian - avatar