I just came across some code that seems to encrypt database keys prior to sending them to the client (WebBrowser, Silverlight, etc).
To illustrate, suppose you have a list of students to extra-curricular activities, and a relationship defined between them. Every time the data is written out to the ASPX page, the studentID and activityID is encrypted. Every time a write, or modify is made, this value is sent back to the server, decrypted, and saved to the database.
What could be the reasons to expose data this way? Is this a normal practice?
Is aspnet_regiis.exe secure? If i encrypt using aspnet_regiis.exe, will it automatically decrypt the string and wont give any error? Need an insight into this stuff.... Is Rsa the best option or wat? Wat's the best way to encrypt/decrypt programmatically?
I have an MVC3 with EF4 project. I have a screen for order .Order has 2 id's inside it for Billilng and Shipping AddressID .When I go and create a new order these fields render as single textboxes as Ids'Question is how can I render full address textboxes (addressline1,city,state,zip etc) do I have drop in the html markup for them? In that case while capturing the data back I willl have to go with classic way of retrieving name/value pair and then do insert into address bring back that identity and update the order record...?
Create(int customerID,FormCollection fc){}
So the main question is how can I do ModelBinding with foreign keys?
I am using Access 2003 Database and I need to retrieve list of a table's foreign keys and tables they are related to in C#. I used GetSchema() function of OleDbConnection as well as OdbcConnection classes. But It just returns the name of key among few other details.
I am developing asp.net MVC3 application and I have following entity
This entity has composite key (CreditRegistryId and Accoubnt No are primary keys). CreditRegistryId is a foreign key as well. How can I make composite key and foreign key. I am using DbContext API from EF 4.1. I am not using edmx ( ORM designer)
I have an EF model with a table with several foreign keys. These foreign keys are managed by associations. In code, I can get a strongly typed list of objects when I access that property on the object.
When I generate a strongly typed view, all I see are the int fields. Is there a way to get ASP.NET MVC to bind to the objects that are related as well as the main object?
I am having trouble with foreign keys Dynamic Data and entity framework 4.0. It feels like there is a problem with the entity association but I am not sure. I have multiple fields representing the foreign key on the insert page.
When I try and insert data I get an error A dependent property in a ReferentialConstraint is mapped to a store-generated column.
Column: 'CommentId'
My data is a very basic one to many relationship, the foreign key in question is BookId in the Comment Table.
[code]...
When I let the scaffolding do its thing, I get multiple fields representing the foreign key.
how to handle foreign keys with Entity Framework, when editing or adding a new record. For example, I have a person table, which has a timezone_id linking to my timezone table.
But the model seems to not include timezone_id. I see it's a new way of doing things, but ... how do I store my record?
My method:
[code]...
I can't do u.timezone_id = timezoneid;
I only have u.timezone (which seems to be the actual entity), and u.timezoneReference, which I am not sure what to do with.
I have the following tables in my database which are as given under:
[code]...
My requirement is instead of getting the PromotionID values displayed for columns CustomerPromotionDiscountID & EmployeePromotionDiscountID, it should display the respective DiscountAmount. Which is not happenning for some reason.
I somehow found a workaround where if i define the datatype for columns CustomerPromotionDiscountID and EmployeePromotionDiscountID as nchar or nvarchar, it displays the DiscountAmount.
Wanted to know if there is any better way of doing this without changing the datatype for my columns?
I use Mysql database, in this i create two table A, B. table A column x and is FK of second table B's column m,n,o provide does it possible that x referncing to foreign key of table B columns m, n , and o all.
Adding data into kartlar table (RehberID,KampanyaID,BrimID) is ok. But which Kart'ID created? I need to learn which Id created after adding data (RehberID,KampanyaID,BrimID) into Kartlar?
[code]...
How can I do that? I want to get data from Kartlar which data I added?
Am trying to get a working enity model with foreign keys working but have run into a problem. I have imported 3 tables with content and some data.Lets call these tables geo_countries, geo_counties, geo_municipalities and the FK are:1. geo_county have a column country_id wich corresponds to country_id in geo_country 2. geo_municipality have a column county_id wich correspond to the county_id in geo_county.The problem i have is when i try to get correspondig child items with the following code i run into trouble:
[Code]....
The problem above is that 'test' generates results but not 'test2', wich never return anything. Am i not supposed to be able to do it like i do in 'test2'? I earlier tried to add a child object by replacing ToList() with Add() and that worked. But i cant seem to get anything out of it.
My current project has many peripheral systems and many different environments (testing, integration, development etc). As expected, we're using .config files to dynamically manage everything.
Instead of updating each relavant key when deploying to an environment, I was hoping there was a way to change 1 key only. Such as:
I've done some searching and haven't come up with an elegant solution. I'm aware that .config files can make use of system variables, but this seems like a bit of a high wire act.
I have set up a ASP.net MVC application which uses the default forms authentication. It uses the ASPNETDB.mdf like shown here:
I then set up another database connection which is similar to the NerdDinner.mdf file above.
I have a post that belongs to a user. It has a UserId value which needs to be a foreign key to the information in ASPNETDB.mdf. When I go to add a foreign key, I can only see information with regards to the table I made. How do I go about doing this?
I have a Dictionary<int, string> cached (for 20 minutes) that has ~120 ID/Name pairs for a reference table. I iterate over this collection when populating dropdown lists and I'm pretty sure this is faster than querying the DB for the full list each time.
My question is more about if it makes sense to use this cached dictionary when displaying records that have a foreign key into this reference table.
Say this cached reference table is a EmployeeType table. If I were to query and display a list of employee names and types should I query for EmployeeName and EmployeeTypeID and use my cached dictionary to grab the EmployeeTypeIDs name as each record is displayed or is it faster to just have the DB grab the EmployeeName and JOIN to get the EmployeeType string bypassing the cached Dictionary all together.
1 - Is it necessary to have foreign key to obtain a Relation in Entity Framework between each entity.? 2 - I have a Language Table and many many table with a foreign key related to the language table. Is it right to add this foreign key or I should do something else ? Ex: Language LangID LangName
I have a web application, which I have a SQL express database attached. I tried to upload a Japanese character into a varchar (max) column, and the result when displaying in the web page is '?'.
I tried to fix by the web config and in the page display to display japanese but it doesnt work.
I have a requirement to have a multiline textbox that accepts any text from any language and stores this into the database for later use. I am using Linq with ASP .NET 3.5 with a SQL Server 2005 database.
found while searching for help on my asp.net application.I have a small application with connected to a SQL database. As it was so small, and contained very little data of any importance, i had set it up with Clear passwords.Now i have been asked to expand the database considerably, and encrypted passwords are now required. I can easily modify the web.config so all future users are set up with encrypted passwords. But is there any way to change all existing users passwords to be stored encrypted?
I'm using ASP.NET membership for a site that will serve primarily sophisticated users. I understand the difference between hashed and encrypted passwords, and I'm trying to decide between the two.After my last client complained bitterly about hashed passwords being a total PITA, I've started to favor encrypted passwords. But someone suggested this just isn't secure enough.So my question is: What, exactly are the risks of encrypting passwords? Any person with the ability to steal passwords by decrypting them from the database would surely have the ability to reset them if they were hashed, no? I'm having trouble seeing where someone could cause trouble with encrypted passwords but couldn't with hashed ones. Making it convenient for users is also important.
I have been trying to encrypt password and found a code which is working with Access fine but as i have changed to SQL it is not decoding the encrypted text.. it amazes me..this SQl code is not letting me log on..