No Value given for one or more required parameters (OledbException) [Resolved]

Posted by Gh1234567 under Regular Expressions on 4/20/2011 | Points: 10 | Views : 7731 | Status : [Member] | Replies : 5
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
Dim EXCELCONN As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\TEST.XLS;Extended Properties='Excel 8.0;HDR=NO'"

'Dim EXCELCON As String = System.Configuration.ConfigurationManager.AppSettings("Connstring")

'Dim EXCELCONN As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\TEST.XLS;Persist Security Info=True"

Dim connection As Data.OleDb.OleDbConnection = New Data.OleDb.OleDbConnection(EXCELCONN)
Dim command As Data.OleDb.OleDbDataAdapter = New Data.OleDb.OleDbDataAdapter("select circle , state, oid from [Sheet1$]", connection)
connection.Open()

Dim ds As New System.Data.DataSet
command.Fill(ds)
gv.DataSource = ds
gv.DataBind()
connection.Close()

End Sub




Responses

Posted by: Gh1234567 on: 4/20/2011 [Member] Starter | Points: 25

Up
0
Down

Resolved
Dim EXCELCONN As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\TEST.XLS;Extended Properties='Excel 8.0;HDR=NO'"

in the above sline just change the HDR =YES

Gh1234567, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Umeshdwivedi on: 4/20/2011 [Member] Starter | Points: 25

Up
0
Down
Hello,
check your database field name,or value

Latest Technology Trainer
And Part time software consultant

Gh1234567, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gh1234567 on: 4/20/2011 [Member] Starter | Points: 25

Up
0
Down
they are the same as taken in the querry

Gh1234567, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gh1234567 on: 4/20/2011 [Member] Starter | Points: 25

Up
0
Down
circle state oid
MAHARASHTRA MAHATASHTRA 1
RAJASTHAN RAJASTHAN 2
KOLKATA WEST BENGAL 3
WEST BENGAL WEST BENGAL 4


Gh1234567, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gh1234567 on: 4/20/2011 [Member] Starter | Points: 25

Up
0
Down
circle state oid
MAHARASHTRA MAHATASHTRA 1
RAJASTHAN RAJASTHAN 2
KOLKATA WEST BENGAL 3
WEST BENGAL WEST BENGAL 4


Gh1234567, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response