Web Forms :: Storing A Constant Table In Database For Reference?
Jun 30, 2010
I am building a website that have a number of dropdownlists. The user selects his/her choice and this is sent to a number of companies. Therefore the choice has to be changed to the corresponding value of the individual company i.e value 1 will be coverted to the corresponding value of "AB" for company "x". What way would be most efficent to achieve this. A database seems to be unefficent with the calls to the database. Would a 2-D array in a class be best?
I would like a situation where there are three textbox available and this would give the user an opportunity to input a value in the textboxes. The value in the textboxes would then be stored in a database table(the table is already created in sql). Furthermore, the value would be able to be reterieved later on when the user presses another button. A sample code will help.
I am a beginner in ASP.NET using VB Code. I want to generate a Unique reference no by concortinating three column fields.Example:
Column unique reference no (System Generated) - 10 Column with Product Code (User Entry) - APPLE Column with Product Title (User Entry) - FRUITS Unique ref No = FRUITS/APPLE/10
I want to concatenate this three fields to the column Unique Ref No.
I have an ASP.NET web form that has a "container" usercontrol that hosts several custom user controls on the page. The controls can be hosted directly in the container or can be children of other usercontrols. The container usercontrol has several public properties exposed that I sometimes need to get to from within the child user controls. I've been using some form of "this.Parent" or "this.Parent.Parent" to get back to the base control.
What would be the impact of storing a reference to "this" into Session from the base control so I can access it from within the event handlers within the user controls?
I am writing an application in which a remote url web site ( says url1 that is sender) sends xml data to another web site (says url2 that is receiver) by using .NET WebRequest. On the receiver url2 if I use .NET Page.Response and .NET Page.Request to store posted/received xml data into an external text file, then the data is stored. However, if I store the received data into database, I do not see the data is stored into the database.
trouble shoot the codes so I can store such remotely posted data into database on the receiver side url2.
I host both url1 site and url2 site in my computer using IIS like [URL]
1/ Receiver page's codes that store remotely posted xml data into database do not work:
protected void Page_Load(object sender, EventArgs e) { Page.Response.ContentType = "text/xml"; StreamReader reader = new StreamReader(Page.Request.InputStream); String xmlData= reader.ReadToEnd(); ProductNameSapce.ProductCollection.InsertReceivedProduct(xmlData).ToString(); // data is not stored ; the method is tested and works well with hard-coded data reader.Close(); Page.Response.End(); }
2/ The version of the receiver page at url2 that stores into an external text file works:
protected void Page_Load(object sender, EventArgs e) { Page.Response.ContentType = "text/xml"; StreamReader reader = new StreamReader ( Page.Request.InputStream ); String xmlData= reader.ReadToEnd (); StreamWriter s; s= File.CreateText ( Server.MapPath(".")+@""+ Guid.NewGuid () + ".txt" ); s.WriteLine ( xmlData); // data is stored in an external text file s.Close (); reader.Close(); Page.Response.End(); }
I suppose this question has been asked to death all over the web, but I can seem to find a clear cut answer. What I am trying to achieve is as follows: I have a web application that lists various products, their descriptions, names etc and also an image of that specific product. The user will type in a product code or name of the product and a page will pop up with al the previous mentioned info and image or images of that specific product. The problem I am having is: I read somewhere that storing images in a database is 'bad idea' since it effects performance, then I read somewhere else to keep it in the images / or app_data folder. But what would be the best approach and how would I call it from the database (if that's the best way)? And if App_Data / images are the way to go how many images can I put in there (??) already the product catalog has several hundred images of various products. So how would one go about sorting everthing in those folders without having a few hundred images rolling down in my solutions explorer.
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.
Friends have quick question for you.i want to know storing videos and images into database(binary data) or local hard drive is efficent. What way general websites stores them in their websites.
i want to create a table for storing email like hotmail
I have 2 idea:
1-create table for for all user(user 1 has its table and user 2 also has its table)
2-create one table for all user and stor the email text in the field that used for email text and seperate the text by character like(, or - or ........)
I am working on the application that allows user to upload a file (from their local machine) and store the uploaded file in database.Then,the content of the file (such as ContentType,FileSize etc)can be view in a DetailsView control.
I have a requirement to allow users in a content management system to create their own image maps through a gui interface, which I have accomplished. But instead of saving the image map to the page code, I want to save the image map code to a database (sql), which I've also accomplished. When I started down this road in my head I was thinking the whole time that I'd just add the "usemap" attribute at runtime shown below where promo1.ImageMap holds the entire map code:
I guess I didn't think it though well enough, because it seems that "usemap" only expects the name of the existing map to use from the page code, and not the map code as a string.
how to apply the map from the database to the image at run time?
I have a function that calculates the exchange rate between two currencies. The inputs are constants:
[Code]....
I have currency codes in my database listed as "EUR", "USD" etc. that I want to use in the function. Unfortunately the function requires a constant value like CurrencyExchangeRate.Currency.EUR instead of a string value called "EUR" How can I turn the value from the database into a usable value for the function?
I know it must be very simple but I cannot figure it out.
Have a question about the best approach for file storage in a SQL database. I have a table called Widgets, and each row in the Widgets table can have multiple files. I also have another table called Extensions, and again each record in this table can have many files.
Here is what I am considering:
Approach #1:
[Code]....
That approach is very simple and easy to use, but I feel that I could merge the two file tables into one, then use lookup tables:
Approach #2:
[Code]....
The thing is, there are no duplicate or shared files between the two types of objects. So even though I feel better about approach #2, I am concerned that I may be adding additional complexity (and using more server resources to perform the joins), than needed.
i am a beginer and i want to know how to store images in the database tables like pictures of the pizzas and when the user selects one of the pizza from the dropdownlist he sees the image of the selected pizza.
In Sqlserver 2008 DataBase one columns of a table is CreatedDate Having datatype :-datetime When i am passing Created Date as DateTime.Now i.e.( objRFEProxy.mCreateDate = DateTime.Now;) in sliverlight codebehind it through error. InnerException {"The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The statement has been terminated."} System.Exception {System.Data.SqlClient.SqlException}
I'm working on a blog and want to show my posts in eastern time zone. i figured that storing everything UTC would be the proper way. This creates a few challenges though:I have to convert all times from UTC to Eastern. This is not a biggie but adds a lot of code.And the "biggie" is that I use a short-date time to reference the posts by passing in a query, ala blogger. The problem is that there is no way to convert the short date time to the proper UTC date because I'm lacking the posted time info.
I have aspxcombobox. There are so many items with different lengths. If i select Small ones the combobox width is in minimum size and if i am selecting larger length item combobox width is increasing to fit the item in it. any property to set the combobox width constant for any item.
i am reading image from database (sql server) by using handler and getting it in memory stream. now i want to store that image on server in the folder named Images.