S
salih ataoz
hi i need help about parameters
i have a login form and a component
i put username,password texboxes and one login button on
the login form
on the component i drag and drop a oledbconnection name
con and an oledbcommand name cmdSelect
at con properties
connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Passwor
d="";User ID=Admin;Data
Source=\\Graphicstudio\KUTUKLER\BASIMEVI.mdb;Mode=Share
Deny None;Extended Properties="";Jet OLEDB:System
database="";Jet OLEDB:Registry Path="";Jet OLEDB
atabase
Password="";Jet OLEDB:Engine Type=5;Jet OLEDB
atabase
Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password="";Jet OLEDB:Create System Database=False;Jet
OLEDB:Encrypt Database=False;Jet OLEDB
on't Copy Locale
on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;Jet OLEDB:SFP=False"
name=con
at cmdselect
commandtext="SELECT * FROM users WHERE (ID = [@ID])"
commandtype=CommandType.StoredProcedure
connection=con
name=cmdselect
Public Sub baglanti(ByVal Kullaniciadi As String,
ByVal Sifre As String)
'Try
con.Open()
cmdSelect.CommandType = CommandType.StoredProcedure
cmdSelect.CommandText = "select * from USERS where id=
[@id]"
cmdSelect.Parameters("id").Value = 1
Dim dr As OleDb.OleDbDataReader
dr = cmdSelect.ExecuteReader
' MsgBox(dr.FieldCount)
While dr.Read
MessageBox.Show("Baglanti hazir")
End While
dr.Close()
con.Close()
End Sub
WHEN I RUN THE PROJECT THERE IS AN ERROR
An unhandled exception of
type 'System.IndexOutOfRangeException' occurred in
system.data.dll
Additional information: An OleDbParameter with
ParameterName 'id' is not contained by this
OleDbParameterCollection.
WHY
i have a login form and a component
i put username,password texboxes and one login button on
the login form
on the component i drag and drop a oledbconnection name
con and an oledbcommand name cmdSelect
at con properties
connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Passwor
d="";User ID=Admin;Data
Source=\\Graphicstudio\KUTUKLER\BASIMEVI.mdb;Mode=Share
Deny None;Extended Properties="";Jet OLEDB:System
database="";Jet OLEDB:Registry Path="";Jet OLEDB
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
Password="";Jet OLEDB:Engine Type=5;Jet OLEDB
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password="";Jet OLEDB:Create System Database=False;Jet
OLEDB:Encrypt Database=False;Jet OLEDB
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;Jet OLEDB:SFP=False"
name=con
at cmdselect
commandtext="SELECT * FROM users WHERE (ID = [@ID])"
commandtype=CommandType.StoredProcedure
connection=con
name=cmdselect
Public Sub baglanti(ByVal Kullaniciadi As String,
ByVal Sifre As String)
'Try
con.Open()
cmdSelect.CommandType = CommandType.StoredProcedure
cmdSelect.CommandText = "select * from USERS where id=
[@id]"
cmdSelect.Parameters("id").Value = 1
Dim dr As OleDb.OleDbDataReader
dr = cmdSelect.ExecuteReader
' MsgBox(dr.FieldCount)
While dr.Read
MessageBox.Show("Baglanti hazir")
End While
dr.Close()
con.Close()
End Sub
WHEN I RUN THE PROJECT THERE IS AN ERROR
An unhandled exception of
type 'System.IndexOutOfRangeException' occurred in
system.data.dll
Additional information: An OleDbParameter with
ParameterName 'id' is not contained by this
OleDbParameterCollection.
WHY