Can a table field be founded and then updated with a value in mvc Controller - asp.net-mvc-4

yeah so the question is pretty simple: Can a table field be found using and ID and then updated with a value in mvc Controller?
And before anyone gets downvote crazy... I have no example because I don't know how to do this... it's not a home work question or any other things that you down vote on this site. It's a simple question that I need an answer and a example.
I now you can use the .find to and pass the ID... to a dataset but there is nothing I can find that shows you how to edit the values in the table once you find it.
So this part I get, This will allow me to find the the id with in the dataset.
TEST_DS tEST_DS = db.TEST_DS.Find(id);
if (tEST_DS == null)
{
return HttpNotFound();
}
Also I know that you see a call to the database like This
db.TEST_TABLE.Add(TEST_DS);
I don't see an option for edit or anything like that.
The task is to update a table field, The field is a status field so when the user makes a change on the mvc create form. When they create a record I want to mark a different table's status field with a number that represents a record was created.
Did a search did not see anything.. thanks may be something mvc can't do because of it's limitations or something.
If you do answer question I will need an example of a link to an example on how to do it. Thanks!!

I was able to make this work some I will post It there for others as they might have the same issues when dealing that mvc limitations and such.
So the answer is to simply have your data table in the dbcontext that you need to edit...
The code would not post.. it asking for 4 spaces and I gave it 4 spaces and it did not work so I added a picture.
See CodeAnswer Image

Related

Oracle Application Express SQL Query to show meaningful information

I am trying to write a query that 1) works and 2) shows meaningful information.
However, I can't seem to complete both scenarios. Both bits of code do work to a degree. My SQL query does work by showing all the useful information a user wants but when you click the edit button it doesn't link properly so it won't allow the user to update that row. The other shows only keys and rowid but when you click edit does show the information and allows it to be updated.
So as not to get another down-voted question, I have taken pictures of each scenario to show the problem, but, ultimately, I need to show meaningful information: an id or key isn't meaningful to the vast majority of users.
Here is my code
SELECT APPLICATIONS.APP_ID, APPLICATIONS.SRN, STUDENTS.SURNAME, STUDENTS.FORENAME, APP_STATUS.STATUS, METHODS.METHOD, JOBS.JOB_TITLE, APPLICATIONS.APP_DATE
FROM APPLICATIONS
JOIN STUDENTS
ON APPLICATIONS.SRN = STUDENTS.SRN
JOIN APP_STATUS
ON APPLICATIONS.STATUS_ID = APP_STATUS.STATUS_ID
JOIN METHODS
ON APPLICATIONS.METHOD_ID = METHODS.METHOD_ID
JOIN JOBS
ON APPLICATIONS.JOB_ID = JOBS.JOB_ID;
and here are the pictures of it in action
below is the code that does not show meaningful information but does work.
select "ROWID",
"APP_ID",
"SRN",
"STATUS_ID",
"METHOD_ID",
"JOB_ID",
"APP_DATE"
from "#OWNER#"."APPLICATIONS"
If i knew how to properly use rowid i am sure this is a simple feat but i dont so if i could get any help it would be useful
//edit
who ever renamed this to Application Expression why? what i am using is Apex Application Express it was relevant information that got changed to something wrong which might make it hard for someone with a similar problem to find later.
In the second, simple query, apex can determine which table (and record) you are trying to edit.
In the first query, with the joins, it can't tell which of the five tables in query you want to edit. You probably want to have the edit link pass the primary key of the row from APPLICATIONS to the child page. You would need to build into that page any logic (lists of values etc) that map lookup tables (such as status) to the values needed in the APPLICATIONS table.

TDBGrid where is the SQL WHERE condition?

I am working on an already started Delphi project where there is a TDBGrid. The grid seems to be filled by a TADOTable that refer to a Bill table in the dataset.
It display a bill by PkBill. I can't seem to find where in the design or in code someone told to load only for this pk.
I need to load multiples Pk at the same time. I'm used to create programmatically a TADOQuery, create a connection, write my SQL code, then do what I want with the result. With those objects/controls, I just don't know where to do that.
Thanks for the help and clarity!
Check TADOTable.MasterSource to see if it's in the Master-Detail relationship.
Or you could check TADOTable.Filtered and TADOTable.Filter to see if it's being filtered by PkBill.

exporting only rows from sql in phpmyadmin, only where a certain column has Boolean of 0

"meta/background about the use of code and person using it"
1.site built by professional that left company,
2.I am inexperienced but trying/ want to learn,
3.Customer support site for service reps,
................................................
What im trying to do exactly per stackoverflows parameters.
We have a drop down box listing issues that the customer had in a column labeled "issue_type". I can export via csv entire table load onto excel then give to boss for overall review of what the issues were. However data base has a "hide" column. Its function is that when the row is updated the record is kept but the same "job or call" has only one viewable report on site (the most recently updated one). Hide is a boolean. In conclusion I want to export rows that only has the "hide" column Boolean status at 0, AND to only export the columns "customer", and "issue_type". I can seem to only do one or the other. and have researched a minimum of 4 hours to find answer myself and cannot find a syntax to do both at the same time with phpmyadmin.
I dont want an enormous data that is mostly useless but for issue type and customer but i will have to manually delete all the rows with hide = 1?
Thanks anyone 1st attempt question sorry if not correct for stackflow.
SELECT Customer,Issue_type FROM tickets where hide =0;
Elaborating on what is above for anyone that may be looking for a similar answer, SQL supports the "where" clause of which you can when properly syntaxed select many of your columns and their associated strings, booleans, and numbers to = what your looking for. Wildcards I found later for other uses work as well.
Sorry about the self answer but hopefully someone finds this usefull

SRSS: Dynamic amount of subreports in a report

it might be possible I'm searching for the wrong keywords, but so far I couldn't find anything useful.
My problem is quite simple: At the moment I get a list of individual Ids through a report parameter, I pass them to a procedure and show the results.
The new request is like this: Instead of showing the list for all individuals at once, there should be a list for each individual id.
Since I'm quite a beginner in srss, I thought the easiest approach would be the best: Create a subreport, copy the shown list, and create a subreport per individual id.
The amount of this IDs is dynamic, so I have to create a dynamic amount of subreports.
Funny enought, this doesnt seem to be possible. This http://forums.asp.net/t/1397645.aspx url doesnt show exactly the problem, but it shows the limit of the subreports.
I even ran trough the whole msdn pages starting http://technet.microsoft.com/en-us/library/dd220581.aspx but I couldnt find anything there.
So is there a possibility, to create a loop like:
For each Individual ID in Individual IDs, create a subreport and pass ONE ID to this?
Or is there another approach I should use to make this work?
I tried to create a 'Fake'-Dataset with no sql query but just for iterating the id list, but it seems the dataset needs a data-source...
As usual, thanks so far for all answers!
Matthias Müller
Or is there another approach I should use to make this work?
You didn't provide much detail about what sort of information needs to be included in the subreport, but assuming it's a small amount of data (say, showing a personnel record), and not a huge amount (such as a persons sales for the last year), a List might be the way to go.
I tried to create a 'Fake'-Dataset with no sql query but just for iterating the id list, but it seems the dataset needs a data-source...
All datasets require a data source, though if you're merely hard-coding some fake return data, any data source will do, even a local SQL instance with nothing in it.

renaming routes in rails 3

I'm new to this, so I'm not expecting that anyone tell me how to do it, just whether it's possible. If so, I'll continue to melt my brain with the docs.
I've been asked to change /markets/4/articles/32
to /markets/111111/articles/999999 where 111111 is in the remoteID field of the markets table and 999999 is in the remoteID field of the articles table.
The reason for this is that an external system will be creating the new records in the RoR app and inserting ITS id into the remoteID field. The next time it goes to update the record, it won't know the RoR ids without creating some kind of lookup.
From what I've seen, it can't be done. Maybe I'm just not looking hard enough?
Thanks,
Kelp
It should be possible, it probably can be changed to something like:
/markets/:market_remote_id/articles/:article_remote_id
It will then be available as params[:market_remote_id] and params[:article_remote_id] in your controller
Have a look at http://guides.rubyonrails.org/routing.html#dynamic-segments for the full story