Showing posts with label key. Show all posts
Showing posts with label key. Show all posts

Monday, March 26, 2012

Newbie Data Relation Problem

I have two tables in a data set

Table Groups
GroupID (Key Int Identity field)
GroupName VarChar

Table Users
Firstnames
Surnames
GroupID (Int taken from GroupsTable.GroupID)

I am trying to set up a windows form which will allow me to display/edit the GroupName field in a combobox with a droplist of the available groups. The documentation says that I need to set up a data relation for this. When I do this it throws an exception when the form is run.

'Additional information: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints'

Of necessity the groupID field in the user table cannot be unique as there will be many users in each group.

How can I do this?

Thanks in anticipation
BrianHi Brian,

Pleaseview post 537644

Jason

Saturday, March 24, 2012

newbie DropDownList inside a GridView cell question

Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
to a DataTable Row element that contains a foriegn key in the data record.
For the DropDownList items, I need data from the primary key in another
table. It almost looks like the DropDownList needs binding to two separate
tables. Is that possible? If so, can someone tell me which DropDownList
property references the foreign key table and which one references the
primary key table?

Thanks,

KeithLook at the source code of this demo:
http://www.webswapp.com/codesamples...s/gridview.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

"keithb" wrote:

> Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
> to a DataTable Row element that contains a foriegn key in the data record.
> For the DropDownList items, I need data from the primary key in another
> table. It almost looks like the DropDownList needs binding to two separate
> tables. Is that possible? If so, can someone tell me which DropDownList
> property references the foreign key table and which one references the
> primary key table?
> Thanks,
> Keith
>

newbie DropDownList inside a GridView cell question

Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
to a DataTable Row element that contains a foriegn key in the data record.
For the DropDownList items, I need data from the primary key in another
table. It almost looks like the DropDownList needs binding to two separate
tables. Is that possible? If so, can someone tell me which DropDownList
property references the foreign key table and which one references the
primary key table?
Thanks,
KeithLook at the source code of this demo:
http://www.webswapp.com/codesamples...s/gridview.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"keithb" wrote:

> Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bou
nd
> to a DataTable Row element that contains a foriegn key in the data record.
> For the DropDownList items, I need data from the primary key in another
> table. It almost looks like the DropDownList needs binding to two separate
> tables. Is that possible? If so, can someone tell me which DropDownList
> property references the foreign key table and which one references the
> primary key table?
> Thanks,
> Keith
>
>

Newbie encryption question

I am going to use Symmetric key encryption and decryption using Rijndael algorithm when registering a new user's password as well as logging some into the application. Is the following the proper process? When the submit button is clicked, pass the value of the password textbox into a variable and encrypt. Then when I get to the point of matching the password against a database to decrypt to plain text and pass it into my stored procedure? Hope this makes sense. Thanks.How are you going to use symmetric key encryption? The user has to send you a key to do that.

What I think you want to do is hash the password. Take a look at the code here:

http://davidhayden.com/blog/dave/archive/2004/02/16/157.aspx
If I use SSL, do I still need to hash the password?
Yes, you will have to hash the password. Keep in mind that SSL just protects the communication between the browser and the server. When you store the password into the database, it will be seen as a normal cleartext password.