Value Given Error - Newbi

  • Thread starter Thread starter MadCrazyNewbie
  • Start date Start date
M

MadCrazyNewbie

Hey Group,

I keep getting a error saying "No Value Given For One Or More Parameters".

Unfortunatly I don`t know where this error is coming from:(. Can I run
through my code line by line, so I can see which line is faulting?

Regards
MCN
 
Hi MCN,

Show some code, I think it is one of your OleDb parameters?
(However withouth code this is a gues which maybe totaly wrong)

Cor
 
No. I run my prog, click on my ToolBar button, which fills quite a few
datasets and verios other things, but when i click it it just pops up and
says ""No Value Given For One Or More Parameters". With a OK button, when I
click OK my prog carries on:(

Many Thanks
MCN
 
MadCrazyNewbie said:
No. I run my prog, click on my ToolBar button, which fills quite a
few datasets and verios other things, but when i click it it just
pops up and says ""No Value Given For One Or More Parameters". With a
OK button, when I click OK my prog carries on:(

Press Ctrl+Break when you see the message and have a look at the callstack
to see (from) where and why the message is shown.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Armin Zingler said:
Press Ctrl+Break when you see the message and have a look at the
callstack to see (from) where and why the message is shown.

....and of course also at the source code...
 
Armin?

I think it can be where you say

"Select A from table where A = @A"

That needed to be filled with a command parameter.

If you do not have that, than it is something else.
(It it is OleDb the parameter is something else)

Cor
 
Armin,

If I press Ctrl+Break on the error, ir carries on running the prog and oks
the error:(

Also what bit of code would you need, theres quite a few lines in it:(

Ta
Si
 
Cor,

I`ve been looking at your suggestion, and I think your right, On my code:

Me.odaArcirisUsers.Fill(dsArcirisUsers)
Me.odaArcirisRoles.Fill(dsArcirisUsers)
Me.odaBomAccess.Fill(dsArcirisUsers)
Me.odaSites.Fill(dsArcirisUsers)

If I Comment out `Me.odaArcirisUsers.Fill(dsArcirisUsers)` It runs without a
error. I`ve Re done my Data Adapeter for ArcirisUsers and Rebuild my Dataset
(See Attached Pic) but it still comes up with the error if I un Comment it:(

Also if I right click on my Data Adapter and try to Preview my Dataset it
errors with the same message:(

Any Ideas?

Ta
MCN
 
MCN,

I think that you than first have to look at the data you have inserted in
the tables in your database.

And do not forget to use the keys in your select statements, I thought that
could give this kind of errors also, however I am not sure of that.

Cor
 
Cor,

Sorry i`ve just notice in ther Data Adapter Query Builder there was a Coloum
which wasn`t related to a Table:(

Thats working Now, but now im getting "Failed to Enable Constraints. One or
more rows contain values wiolating non-null, unique, or foreign-key
contraints"

Many Thanks
MCN
 
Cor,

I`ve been looking at this, and its deffinatly now something to do with my
Dataset Bindings (I think). Now im getting an error saying "Foreign Key
Contraint "SiteArcirsUsers" Requires the Child Key Value (1) to exsist in
the Parent Table"

Any Ideas?

Im wondering if I have my relationships are set the wrong way round. As my
Arciris Users Table Looks up the SiteName from My Sites table, the BomAccess
from my BomAceess table, and my Role from My Roles Table. I would have
guessed that my Sites Table is the Parent as it can have many Arciris Users,
as with My BomAccess Table and my Roles Table. Or am I barking up the wrong
tree?

Many Thanks
MCN
 
Hi,

MCN are you sure the keys are a part of all your select,

with that I mean either

select * from BomAcess
or
Select BomAccessId, Accesslevel from BomAccess

Cor
 
Cor,

I have the following Select Statements:

From my odaArcirisRoles: SELECT ArcirisRolesID, Roles FROM ArcirisRoles
From my odaSites: SELECT Address, [E-Mail], Fax, Postcode, Site, SitesID,
Tel, Town FROM Sites
From my odaBomAccess: SELECT AccessLevel, BomAccessID FROM BomAccess
From my odaAricirsUsers: SELECT ArcirisRolesID, ArcirisUsersID, BomAccessID,
BomUsersName, Notes, [Password], POSID, SetupDate, SitesID, Usersname FROM
ArcirisUsers

Ta
MCN
 
Hi MCN,

Any reason for not just a *, you use all datanames (However you have to know
I hate SQL and do not rely to much in that on me). I see also, which cannot
have to do with it, that in your sample you use BomUsersNam and in the
select BomUsersName with a * that is no problem (or is that the field size
in the picture).

And what is the reason you made those relations in your database where you
are not using them in your select?

Just some thougths,

Cor
 
Sorry Cor, what do you mean by:
And what is the reason you made those relations in your database where you
are not using them in your select?

I build a seperate DataAdapter for each Table then bind that in the Dataset.

Then I use the following code to fill them:

cmDsPasswordList = BindingContext(dsPasswordList, "PasswordList")
cmDsArcirisUsers = BindingContext(dsArcirisUsers, "ArcirisUsers")
mlLoading = True
'Start of Fill Datasets
Try
dsPasswordList.EnforceConstraints = False
Try
Me.odcPasswordLists.Open()
'Fill Password Lists Datasets
Me.odaDepartments.Fill(dsPasswordList)
Me.odaPasswordList.Fill(dsPasswordList)
'Fill Arciris Users Datasets
Me.odaArcirisUsers.Fill(dsArcirisUsers)
'Me.odaArcirisRoles.Fill(dsArcirisUsers)
'Me.odaBomAccess.Fill(dsArcirisUsers)
'Me.odaSites.Fill(dsArcirisUsers)
Catch fillException As System.Exception
Throw fillException
Finally
dsPasswordList.EnforceConstraints = True
Me.odcPasswordLists.Close()
End Try
Catch eLoad As System.Exception
System.Windows.Forms.MessageBox.Show(eLoad.Message)
Finally
mlLoading = False
End Try

I think it was the pic aswell, i`ve check and it BomUsersName on both.

Ta
MCN
 
Hi MCN

I see also no problems, maybe I am blind or just do not know something
It are 4 seperated tables that you read in a dataset using 4 different
dataadapters.
I do not see what is the importance of the key in that.

However I think the best you can do is put that code without the picture but
with the selects in the newsgroup
microsoft.public.dotnet.framework.adonet
And do not tell I did look for it.
I will also watch who sees it.

Cor
 
Cor,

If I delete my relations in my dataset it, works, well dosn`t give me any
errors, so its deffo to do with my bindings.

Can you see anything wrong, with my XML Schema below?

<?xml version="1.0" standalone="yes" ?>
<xs:schema id="dsArcirisUsers"
targetNamespace="http://www.tempuri.org/dsArcirisUsers.xsd"
xmlns:mstns="http://www.tempuri.org/dsArcirisUsers.xsd"
xmlns="http://www.tempuri.org/dsArcirisUsers.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="dsArcirisUsers" msdata:IsDataSet="true"
msdata:Locale="en-GB">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="ArcirisRoles">
<xs:complexType>
<xs:sequence>
<xs:element name="ArcirisRolesID" msdata:AutoIncrement="true" type="xs:int"
/>
<xs:element name="Roles" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ArcirisUsers">
<xs:complexType>
<xs:sequence>
<xs:element name="ArcirisRolesID" type="xs:int" minOccurs="0" />
<xs:element name="ArcirisUsersID" msdata:AutoIncrement="true" type="xs:int"
/>
<xs:element name="BomAccessID" type="xs:int" minOccurs="0" />
<xs:element name="BomUsersName" type="xs:string" minOccurs="0" />
<xs:element name="Notes" type="xs:string" minOccurs="0" />
<xs:element name="Password" type="xs:string" minOccurs="0" />
<xs:element name="POSID" type="xs:double" minOccurs="0" />
<xs:element name="SetupDate" type="xs:dateTime" minOccurs="0" />
<xs:element name="SitesID" type="xs:int" minOccurs="0" />
<xs:element name="Usersname" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="BomAccess">
<xs:complexType>
<xs:sequence>
<xs:element name="AccessLevel" type="xs:string" minOccurs="0" />
<xs:element name="BomAccessID" msdata:AutoIncrement="true" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Sites">
<xs:complexType>
<xs:sequence>
<xs:element name="Address" type="xs:string" minOccurs="0" />
<xs:element name="E-Mail" type="xs:string" minOccurs="0" />
<xs:element name="Fax" type="xs:string" minOccurs="0" />
<xs:element name="Postcode" type="xs:string" minOccurs="0" />
<xs:element name="Site" type="xs:string" minOccurs="0" />
<xs:element name="SitesID" msdata:AutoIncrement="true" type="xs:int" />
<xs:element name="Tel" type="xs:string" minOccurs="0" />
<xs:element name="Town" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:ArcirisRoles" />
<xs:field xpath="mstns:ArcirisRolesID" />
</xs:unique>
<xs:unique name="ArcirisUsers_Constraint1"
msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:ArcirisUsers" />
<xs:field xpath="mstns:ArcirisUsersID" />
</xs:unique>
<xs:unique name="BomAccess_Constraint1" msdata:ConstraintName="Constraint1"
msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:BomAccess" />
<xs:field xpath="mstns:BomAccessID" />
</xs:unique>
<xs:unique name="Sites_Constraint1" msdata:ConstraintName="Constraint1"
msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Sites" />
<xs:field xpath="mstns:SitesID" />
</xs:unique>
<xs:keyref name="ArcirisRolesArcirisUsers" refer="mstns:Constraint1"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//mstns:ArcirisUsers" />
<xs:field xpath="mstns:ArcirisRolesID" />
</xs:keyref>
<xs:keyref name="BomAccessArcirisUsers" refer="mstns:BomAccess_Constraint1"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//mstns:ArcirisUsers" />
<xs:field xpath="mstns:BomAccessID" />
</xs:keyref>
<xs:keyref name="SitesArcirisUsers" refer="mstns:Sites_Constraint1"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//mstns:ArcirisUsers" />
<xs:field xpath="mstns:SitesID" />
</xs:keyref>
</xs:element>
</xs:schema>

Many Thanks
MCN
 
Back
Top