In my database one user can have multiple order. i want to get all orders for a user and save it in a list.
this is what i'm doing now
Public Function GetUserOrders(ByVal userID As Integer) As DataSet
Dim sqlDA As New SqlDataAdapter
Dim ds As New DataSet
Dim myCommand As New Data.SqlClient.SqlCommand("sp_GetUserOrders", myConnection)
[Code]....
but i can't seem to figure out how to assign the results to a list.
Dim orderList As New ListItemCollection()
orderlist = GetUserOrders()
I have a common problem in an ASP.NET web form. I'm just surprised that I haven't found a common solution :)
I have a list of results being returned from a SQL Server database. I want to show those results in my web page with number to the left of them. For instance, my result set may look like the following:
New York | NY Chicago | IL Los Angeles | CA
In my web page, I would like to show them as:
1. New York, NY 2. Chicago, IL 3. Los Angeles, CA
I was surprised that I can't find a way to make the numbers automatically appear. Am i doing something wrong? If not, what is the recommended approach?
In the following code i want to save the value selected by user from drop downlist into database. but whatever value is selected by user, first value of dropdown lsit is saved to database
View <% =Html.DropDownList("lstUsertype", (SelectList)ViewData["UserTypeID"])%> Controller public ActionResult CreateUser() { UmUser _UmUser = new UmUser(); UMRepository _UMRepository = new UMRepository(); EvoLetDataContext db = new EvoLetDataContext(); ViewData["UserTypeID"] = new SelectList(_UMRepository.FillUserTypes(), "UserTypeID", "UserType",2); return View(_UmUser); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult CreateUser(UmUser _umUser) { //try //{ if (ModelState.IsValid) { //try //{ UserRepository _UserRepository = new UserRepository(); _UserRepository.Add(_umUser); _UserRepository.Save(); return RedirectToAction("Details", new { id = _umUser.UserID }); /*} catch { ModelState.AddModelErrors(_umUser.GetRuleViolations()); }*/ } return View(); //} /*catch { return View(); }*/ }
I'm having a bit of trouble with knowing how I can save items from a list I have in Application state in the global.asax as- Application[""].
My controller basically takes in some user input, I then pass this to another classes Method as parameters it gets added to a list all the time. This data thats getting added to the list I want to store it, but without using a db. By using Application State. . I have been instantiating this class and calling its method to return the list of items but I dont think Application State is saving it.
Here is what I have so far. .
protected void Application_Start() { RegisterRoutes(RouteTable.Routes); TimeLineInformation t = new TimeLineInformation(); IList<SWTimeEnvInfoDTO> g = t.getInfo();
[Code]....
The SWTimeEnvInfoDTO type has get and set methods for the data.
I am calling the application from a View as well. It works with a string
The program gives me a list of checkboxes but a user ID. then u user can change his selection and push the save button (id="btnSaveUserIntersts") and i am trying to save in the hidden textbox all the values of the checkboxes that was choosen.
The problem is that i am getting all the time the same selections that came form the database and not getting the new selection that the user made.
I am trying to save the every date clicked in a List of Date using a session variable. I am getting a casting error ..."when casting a number the number must be less than infinity".
I have to save a fileshare link in a sharepoint list and i want that file to be opened when the link is clicked, the normal sharepoint hyperlink column does not work for me in this case as it embeds the http:// with the url. How can I handle this scenario? the link i want to save is in the format 192.168.1.2myservermyfile.pdf and the text to be shown in the column is "myfile"
I am wondering into the unknown field of OOA and was looking for a way to separate my business logic from my UI. A small example is as followed:
Two DropDowns where the second one is depended on the selection in the first DropDown. You have Cars, planes, etc. inm the first DropDown and Toyota, Chrysler, etc in the second (depending on the value in the first DD.I have som Lin syntax. The file is situated in the App_Code folder and NOT as code behind. [Code]....
I would like to know how i can make populate my second Dropdown list with results. At this point it's just putting in the complete ProductSubCategory.
I am developing page for maintaing employee record using Visual Studio 2008, MS SQL server 2005. I am able to fetch and display all the employee information in gridview, the gridview have the dropdown list to display the employee type [ Part Time, Full Time, Permanent , Contract ], in the item template i am having dropdown list. IN the dropdown list i am displaying this. But While saving the record in gridview the droppdown selected index are changed to 0 of other dropdown list.
the user may be change the dropdown value from permanent to contract, or so. but while click on the save button in gridview, all the previous selection are gone, and always showing the first record of dropdown list. I know this is happening because we are doing dropdown list bind on onRowDataBound.
I have a page where users can search by company name, the data list is pulled from an Excel spreadsheet hosted on the site. I'm seeing some strange results returned, for example:
In the company field say there are the following entries:
Anns Company Bernards Business Company B Dermots Domain Property Company
If I search for "Com" I get the following returns (correct):
Anns Company Company B Property Company
If I search for "Der" I get my "Sorry there are no matching results" message (Incorrect)
If I search for "Ann" I get the following returns (Correct):
Anns Company
And if I search for "e" I get the following returns (Correct):
Bernards Business Dermots Domain Property Company
It seems random as to why it doesn't return some values, I've tried moving rows around to see if that's the problem but it makes no difference. My range is set correctly in the spreadsheet.
When I debug the VB code behind, when I search for something that works correctly e.g. "Com" in the above example, once enter the value and click search Visual Studio begins steping into the code and shows me the contents of the variables however when I search for something that's not working e.g. "Der" and click search it immediatly returns the "Sorry there are no matching results" message and the code behind does not get steped into.
How can i generate dropdown lists based on what has been selected in the checckbox list. Below is an example of what i need. if the user selects the options day, lotID and waferID, then 3 cascading dropdown lists should be displayed. And then a gridview displays data based on what has been chosen in the dropdown lists.
Day LotID SlotID WaferID VendorID ToolID LocationDetected ProcessStep Stage Precipe WaferStartMaterial WaferStartVendor WaferStartLot WaferDiameterCOA WaferMapTitle BreakPoint BreakpointSide BreakpointMeasurement
I have drop down list box that I would like to show two columns, is this possible? Or can it be done with a list box?The query correctly retrieves all of the table data to be displayed, one colum is an abbreviation, the other a bit longer description.
Clicking the label of a drop down list, re-sets the selected value to the first item in the list. This has a history of causing data entry problems when users accidently click on the label.
In the below example ddlContactType has a selected value as 'PRIMARY' and whenever i click on the lblContactType Text, the dropdown box Selected value is changing to "Select One" Text.
How to prevent this one. It should be on PRIMARY Only.
I have a databound dropdownlist and have a problem with the default value it selects.When I attempt to edit a record the dropdownlist shows the first value in the list rather than the current value. I want the dropdown list to display the current value.
I'm sure this is very simple but I'm very new to ASP.NET.
I have a webform that has multiple textboxes that the user fills in plus a datatable that could have one record or multiple records. Basically it's an order page, I'm still a newbie and I would like to save this information to a sql db table. The user would fill out the textboxes with name, address, ect.. and the datatable contains products that they selected from a previous screen. I'd like to have a "Submit Order" button, when that is pressed the information on the webform gets saved as a record within the db. If there are multiple records in the datatable the name and address information could be saved multiple times (one per each record in the datatable)
I'm trying to progam a strongly typed "Create" view using MVC 3 and razor. I want the user to be able to select a customer from a dropdown list (I populated this from my database using ViewBag in the controller). When the user has selected a customer I want a separate dropdown list to generate a list of dogs belonging to that customer related by the customerID in the database. The create button on the form will then take both of these values along with the the other fields and save it to the database.
I have a requirement in my application that, while saving the application, need to get all the value from drop down list and pass it to the view model. But application should not allow the user to select more than one item from drop down list manually, ie, only one value at a time. My view model is like ...
public class ListManagement { public IEnumerable<selectListItem> InactiveProduct { get; set; } public string[] InactiveProductSelected { get; set; } public IEnumerable<selectListItem> ActiveProduct { get; set; } }
Now I want to attach to the click-event of every single li-element, so that if the user clicks on a div-element, detailed product-informationen should be loaded asynchronously into a details-pane. I know how I can use jQuery to invoke an action-method ajax-style and also how to display the json-result which contains the product-details, BUT I have no idea, how I could attach the onclick-event to every single div, so that I can use the productId to load the details.