I need to work with some rows of data and then update the database as I do using SQL similar to the following:
[Code]....
My question is: Is there any reason at all why I'd want to use EF for this?
I'm using Entity Frameworks in this project so I'd even be willing to use it to maintain project consistency if all else were equal. But I'm thinking it is just more work in this case. Instead of a simple SQL statement, I must query the data, change it, and then update it, which is not only less work but far less efficient as well.
Perhaps EF has an efficient way of doing stuff like this that I just don't yet know about?
Ive created a web site using VS2008 ASP.net and connected to a Firebird Database.
I have a page that has a GridView(added at design time) and have connected to a table at runtime.
[Code]....
All good as the table contents are displayed at 10 rows per page. Ive set the Property AllowSorting to True. Has anyone got examples on how to code the sorting? Ive had a look round the net but all the examples Ive tried dont work.
String is immutable and StringBuilder is mutable. So if I change the value of a string a new memory created with the new value, whereas in StringBuilder it updates its memory location rather than creating a new memory location. So for large concatenation stringBuilders are preffered. But when I create a new String object, a fixed memory is created. And any changes will update its memory location, rather than creating a new memory location.
For e.g. String s = new String(); s = String.Empty; for ( int i=0;i<100; i++) { //s = s + "test" + i.ToString(); s =string.Concat(s, "test" + i.ToString()); ///This is effecient compared to previous step }
Now instead of String class I will use a StringBuilder class.
StringBuilder s = new StringBuilder(String.Empty);
for ( int i=0;i<100; i++) { //s = s + "test" + i.ToString(); s.append( "test" + i.ToString()); }
So I'm trying to make my own forum signature generator for some friends, and I've gotten most of the work done. My real issue now is refreshing the information when the image is requested from my server.
Basically, I'm looking for someone to push me in the right direction on how to have the image refresh from the datasource when it gets requested, but only if it has been more than 5 minutes to prevent an overload.
Is there a simple way to have dynamic forms? I mean depending on X, show a form with X properties? Right now Im forced to create a model for each form I'm going to show. But I would like it to be optional and ofcorse have the Html.Summaryvalidator work.
im messing around with MVC3 and Razor trying to learn what i can here. Im trying to create a very simple post and replies site while learning all this new stuff.
[Code]....
I have two tables one for messages and one for replies. @model MvcGroupie.Models.Message this starts off the page but i cant add @model MvcGroupie.Models.Reply or it wipes out the other. I tried using a partial view as you can see to do this and that fails too.
Is the ASPNETDB.MDF ok for a production environment? or for small websites? Some sites will only have a few users(under 1 or 2) just for simple administration.
I want to start creating sites with simple backends! I don't know much about databases though and I don't want to jump straight into creating sites with databases anyway. So I want to find out what the best way of creating a simple backend without using a database is.
I have an asp.net webpage which is a prices page detailing the prices of services at a hair salon. The prices change every 6 months so I want to give the client a simple backend so he can update the prices himself. The backend will just be a table of inputs populated with the current prices which can be changed and then click 'save changes' to update the site.
Now what is the best way of implementing this?
A) In the prices page, hard code an html table, within each cell code a <span> tag with an id for the price that will go within the span tag like id="menscut" and within the span tag hard code the price of the service. Then wirte a C# class called 'edit' that is used when the 'save changes' button is clicked on the backend page. When 'save changes' is clicked the 'edit' class parses the prices.aspx page and finds <span id="menscut">£20</span> and then changes it to <span id="menscut">£22</span> (or what ever new price has been entered in the backend) and then saves the new edited prices.aspx page over the old one on the server.
or
B) Don't hard code prices into the prices.aspx but instead store the prices in a seperate .txt or .xml file. Every time the prices.aspx page loads it runs a class called 'populate' which extracts the prices from the .txt file or .xml file and inserts them into the table in the prices.aspx page. And now the edit class instead of editing the prices.aspx page it edits the .txt or .xml file.
So which of those ways is better, or if they are fairly even pegged what are the pros and cons of each?
Or are there any other options I haven't thought of?
I am looking to create a simple windows program that would allow users to calculate their holiday entitlement based on a few simple rules (length of service, job grade, % full-time). Users would use drop-down lists to select their relevant fields, and the holiday entitlement would be calculated from the values given. For example, someone at job grade '1' with 2 years of service gets 25 days a year, whilst someone else on job grade '1' with 4 years service gets 28 days. Is this sort of program possible in Visual Studio 2008?
I am going to deploy my Application on server but instead of specifying connection string (servername .server userid , password) in web.config manually is their any way of entering the server details in the web.confi file dynamically from client side when i first run the application.
in the starting page the user must specify the server details and database name from which  he want the data to be loaded .And once i enter the server details it should bepermanently stored in the web.config file instead of dataabse.
I have an ASP.Net 3.5 application with a menu. The menu is set to an xmlDataSource. The xmlDataSource is given the menus for the user as a dataset. The xmlDataSource uses an xsl transform file.Here is the code behind:
[Code]....
My problem is, when another user logs into the system, he/she gets the previous user's menus. This is based on time somehow, because if you wait long enough after another user has left a page, you'll get the proper menus.Could it have something to do with page caching? Is there something I'm missing with menus?
We have a requirement of creating an input page which might be different for different users, changing will be in terms of number and type of fields. How should I architect this page. Should i create page using "XML and XSLT" or "XML and database fields" or is there any more flexible way to create this type of page. I couldn't visualise the flow in which this should be implemented.
I have an xml feed that contains a list of form fields that I need to create and then submit to the server once a user has filled it out. Below is a snippet of the xml I am working with. how I should go about creating these controls and retrieving their values on postback?
currently i have db name , server name & coonection credentials for sql daTAbase hardcoded in webconfig but i need to create a dynamic connection string in which db name will change currenly i have a main .aspx with a button & on its click event i get the connection string frm webconfig and move on to next page
wht i need is in the main page i need to populate all the db of a particullar server in a dropdown the user will first select the db frm drpdown & click the button & with the db name frm dropdown connection string shld be formed
I created this simple dynamic data form using Dreamweaver cs4, ASP VB technology and a MySQL Database: I love all of the extended functionality that VWD 10 provided, but the most important functionality for me is to be able to completely design a dynamic data table any way I want.
I noticed after researching extensively that the GridView, ListView and DetailsView templates still leave me very limited in what I can design. My question: is there a way for me to design a table in a details page with record placeholders that will be fetched from a master/detail page set?
i am working on a project in which i have to create newsletters. We wish to give user functionality of editing the complete layout ( drag and drop if possible) I am able to achieve drag and drop with web parts but can't customise them much like adding richtext box and saving multiple copies of same page with different layouts. I then wish to enable user to send the html only part of page which contains dynamic layout.
I've created some dynamic buttons on page load but the buttons need to have an onserverclick event and pass a value. I used buttons because they can pass a value. My code below so far, just outputs onserverlick to the html page, which is obviously not what I want. Would it be possible to use some other method, I originally used hyperlinks until I needed to pass a value (I didn't want to use querystrings). [Code]....
I am creating a dynamic <asp:Table> based on a user's selection from a DropDownList. The number of columns and rows in the table depends on the user's choice from the DropDown.
The final two columns in each row needs to contain an Edit and Delete button. I am able to create these buttons programmatically. However, I am unable to get the click event to fire.
After researching this, it appears to be the case that my dynamic Web controls need to be created in the page Init method.
However, I am unable to do this as I do not know how many table rows, columns and buttons to create, until after the user has made a selection from a DropdownList.
I would be be very grateful for some tips on the correct way to create and enable the events for my dynamic buttons, in this scenario.
Here is a brief outline of how the program currently works (this is just a brief outline I quickly sketched, small details may be wrong!):
I need some high-level advice on how to deal with this issue. I want to have dynamically created buttons, each with a different CommandArgument, that call an OnCommand event when clicked. Given that these are dynamic buttons, I have to re-create them in Page_Load after the postback. However, when I re-create the buttons, the orginal command arguments are lost, and the arguments generated after the postback are only valid.As you'd expect, if I don't recreate the buttons, the event handler is never called because the buttons don't exist.My question is, how can I retrieve those original commandarguments, without the use of sessions.
I'm presenting a list of products within a ListView. Each product can have associated "Options" (Size, Colour etc), but may have none. For each product that gets added, I need to render a dropdownlist for each of its options. E.g. A "Colour" dropdown might have "Black", "White", "Red" etc. I need to generate these controls dynamically, as they are defined by the data itself.
So far, so good. The dropdowns are rendered, and everything "looks" good. The trouble is, I can't work out how to actually get it to work. .Net is complaining about "EnableEventValidation", and ViewState won't work as I've added the controls late in the page's life cycle. As these controls are dynamic, I don't know how to pick up the selected values, and persist them on a post back! When the user clicks on the "Add to basket" option for the product, I need to determine which options the user has selected, and add them to the basket.
Am I missing something here? Is there an easier way of achieving this? I kind-of feel like I'm in a "chicken and egg" situation here. I can't create the controls until the data is loaded (in the ItemDataBound event), but that too late for ViewState. Is there a generally accepted best approach for achieving this sort of thing in ASP/Net?