retrieve values from database using Id in mvc2 - asp.net-mvc-2

I want to retrieve particular values from database using Id..
Orgvasplans
Id
vasplanId
orgId
createdDate
vasplans
Id
Name
Amount
Validity
The "vasplans" table values are already stored in database.. when I click button, it is automatically taken value from vasplans table and store into orgvasplans table. Also created date will store..
In view, it will retrieve the values from orgvasplans table... But I have problem with vasplanId. can anyone please check and tell me?

Related

TYPO3 TCA fill in a field with the year of creation and the UID

I have created a new field in the TCA. This is now empty. Now I would like to fill this in with the creation year and the current UID when creating the data record or afterwards.
Do I have to do this via hooks or tasks?
As the uid of a new record is unknown until the record is saved there could not be a prefill.
Of course you could create a scheduler task to set a field with the value from the creation date (field cr_date) and uid regulary.
But a better solution would be a hook after the record creation as it would be less overhead.
On the other side: as the relevant data already is stored in every record (cr_date and uid):
do you realy need another field with the same information?

Track history of ManyToMany Relationship table with extra fields

I have a many to many relationship table (named UserLabel) in the postgres db with some extra field. I want to be able to track the history of changes to this many to many table. I came up with the following structure. I'd like to know if there's any better way of implementing it
User
id
Label
id
UserLabel
id
user_id
label_id
label_info (jsonb)
is_deleted (true or false)
UserLabel can contain more than one record with same user_id and label_id but with different label_info. At any point of time, if I want to query for all the labels for a given user I can do that using this table. Now, updates could occur on this table on label_id or label_info or is_deleted fields. I want to be able to know at any given point of time, what were the labels and label info of a user. For this, I'm using the below table.
UserLabelEvent
id
user_label_id
user_id
label_id
label_info
change_type (value will be one of (create, update, delete))
created_timestamp
If I want to check the user labels for any user at any time, I just have to query on user_id and created_timestamp and order the records by created_timestamp and loop over the records to construct the user labels at any given time.
The problems in my current approach:
By default, anyone seeing at the schema of UserLabel table feels like there cannot be more than one record with same user_id and same label_id.
By looking at the UserLabelEvent, it's not obvious to understand how that table is working.
I need to do some post processing to find out the user labels at any given time. By post processing, I mean, loop over the query results and construct the user labels.
Please do suggest any other problems you find with this approach. I will update the post with new inputs.

oracle form ''you cannot update this record''

I have a procedure in which I get values from different tables and calculate a certain decimal number. After that i try to post it on a form text-field which is a database item (update and insert allowed on the settings of block and item). everything works fine but the result wont show on the item and won't save in the database field. I get the error
"you cannot update this record".
Can someone help? i have been working on it for two days now and can't find anything.
Did you check if your user has update access on the table?
Check also if there are database triggers on the table that prevents you from updating the record.

How to get the column value of table for Excel sheet column values?

In my Excel Sheet i have the product name ,i need to get primary key of the product from product master table and the same should be insert into transaction table , how i can perform this process by using talend?
Check out tmap component. The tmap allows you to have the main data flow and perform lookups on that data and retrieve data from the lookups.

Inserting data properly in to sqlite database

I am developing an app that contains a view controller,where the user fills all the fields and when he clicks save,the data must get inserted in to the database.I am able to retrieve the primary key (id) for every reminder saved.But I am unable to insert data,as when I am trying to display it in console,it's displaying null.Please post the correct and relevant code of my requirement to save the data in to created table in database.
It's my humble request to post the code for performing an action in such a way that when I click save,the data must get inserted in to the table of database.I would be pretty glad If I can see the code for retrieval of data to display in the other controller(page) "View/Edit Reminder"...Please help me out.I tried all the ways,I have gone through 100's of solutions.
retrieved data from sqlite database and displaying it on grouped table view
Sqlite iPhone data insertion problem
how to insert value from one table to other table in sqlite3 database
SQLite3 database doesn't actually insert data - iPhone
Why does SQLite not bring back any results from my database
http://www.edumobile.org/iphone/iphone-programming-tutorials/adding-data-using-sqlite-for-iphone/
etc... etc... Please make me get out of this problem
Check the answer of this question:
Storing and retrieving data from sqlite database
It shows how to connect to a database, insert a new record, and retrieve an old one.
Check Out this link:-
how to insert only one username and password in sqlite database
I have explain two method first is how to read from a table and second how to write inside the database.Just before calling any of these methods you have to call the method checkandCreateDatabase.