Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is my code

VB
Dim s As String
       s = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.CardNo, Voter.CardNo, Voter.Cast FROM Voter WHERE (((Voter.Cast) [Is Null]))"
       Dim da As New OleDbDataAdapter(s, My.Settings.trialConnectionString)
       Dim ds As New DataSet
       da.Fill(ds, "voter")
       DataGridView1.DataSource = ds.Tables("voter")


Error
IErrorInfo.GetDescription failed with E_FAIL(0x80004005)
Posted

I think keyword problem(Cast) here. Try the following
VB
s = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.CardNo, Voter.CardNo, [Voter.Cast] FROM Voter WHERE [Voter.Cast]"

I don't know what database you're using? that's why I mentioned only partial query(I removed NULL condition). So Complete the query before execution.
 
Share this answer
 
VB
Dim s As String
       s = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.CardNo, Voter.CardNo, Voter.Cast FROM Voter WHERE (((Voter.Cast) [Is Null]))"
       Dim da As New OleDbDataAdapter(s, My.Settings.trialConnectionString)
       Dim ds As New DataSet
       da.Fill(ds, "voter")
       DataGridView1.DataSource = ds.Tables("voter")


In the upper code there is an "cast" is an the reserved key word
only i was change the "cast" into "castt" and it can be excute
VB
Dim s As String
       s = "SELECT Voter.SrNo, Voter.YadiNo, Voter.FullName, Voter.Gender, Voter.Age, Voter.HouseNo, Voter.CardNo, Voter.CardNo, Voter.Castt FROM Voter WHERE (((Voter.Castt) [Is Null]))"
       Dim da As New OleDbDataAdapter(s, My.Settings.trialConnectionString)
       Dim ds As New DataSet
       da.Fill(ds, "voter")
       DataGridView1.DataSource = ds.Tables("voter")
 
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