I have one AsyncFileUpload control ,one Attach button,one Listbox and Save button.
When Users browse the file and click the attach button, filename must be added to listbox. So in this way the user has the option to add upto multiple filenames to listbox. For this i have written the following code
[Code]....
this is source code
[Code]....
In Attach button click event i added the filename to listbox and saved the Asyncfileupload controls in different session variable.
When user clicks on save button all files has to be saved in application folder and for this i wrote the following code.
[Code]....
But iam unable to save all the files . Suppose i added two AsyncFileupload controls to session variables, only last file i,e. 2nd file can only be saved and couldn't get first file.
I'm working on a MVC3 application and I created my POCO classes from my database with the DbContext Code Generator. All goes fine until I got stuck in this situation. Note that I use the repository pattern and I use for every entity a dedicated repository that every get a new instance of the DbContext.
Now, I'm in this situation:
object A has a relation one-to-many with B (A can have one or many B) object B has a relation many-to-one with C (C can have one or many B) object B has a relation many-to-one with D (D can have one or many B)
I should add a new object B, consider that object C and D are yet existing, so I must only do the relation and the object A can be created or updated. In the specific consider that A is customer and B is subscriptions (C and D are virtual objects properties in the B).Now If I try to save I got duplicates in C and D tables, while the management of the object seems to work.
Here's the code: [Code]....
And here the add and the save method of the customer repository: [Code]....
Should I check for every relation and modify the state of the entry to Unchanged or something like that ?
I have to find a design decision for the following task: I have a SQL Server database and it contains a table of orders. PDF documents will be uploaded by users through a simple file upload from a web page and assigned to an order. There is not more than one document per order (perhaps no document, never more than one). For this purpose a user opens a web page, enters an order number, gets the order displayed and clicks on an upload button. So I know to which order the uploaded document belongs to.
Now I am considering two options to store the documents on the web server:
1) Extend my table of orders by a varbinary(MAX) column and store the PDF document directly into that binary field.
2) Save the PDF file in a specific folder on disk and give it a unique name related to the order (for instance my order number which is a primary key in the database, or a GUID which I could store in an additional column of the order table). Perhaps I have to store the files in subfolders, one per month, and store the subfolder name into the order row in the database, to avoid getting too many thousand files in one folder.
After the PDF files are stored they can be downloaded and viewed via browser after entering the related order number.
I'm tending towards option (1) because the data management seems easier to me having all relevant data in one database. But I am a bit afraid that I could encounter performance issues over time since my database size will grow much faster than with solution (2). Around 90% or even 95% of the total database size would be made up only by those stored PDF files.
Here is some additional information:
The PDF files will have a size of around 100 Kilobyte each Around 1500 orders/PDF files per month Windows Server 2008 R2 / IIS 7.5 SQL Server 2008 SP1 Express Not quite sure about the hardware, I believe one QuadCore Proc. and 4 GB RAM Application is written in ASP.NET Webforms 3.5 SP1
(I am aware that I will reach the 4GB-limit of the SQL Server Express edition after around 2 years with the numbers above. But we can disregard this here, either removing old data from the database or upgrading to a full license will be a possible option.)
My question is: What are the Pro and Contras of the options and what would you recommend? Perhaps someone had a similar task and can report about his experience.
in my project i would like to save pdf files in database, how to save pdf files in database ? along with that i would like to create create a search page to search for pdf files with PDF file names , how to accoplish these things
in my project i have a folder containing N number of files. I need a functionality that the page should have links for all those files so that client can download those files.
For this i have dynamically created Link Buttons and linked each file with each link Button.
But the problem is that, when i am trying to download this:
the file is downloading in HTML format, moreover the file name of downloaded file becomes same to my Code file name where as i want the actual name. the downloaded file have the actual data but it also contains the html code to the page on which this links are coming
have some Objects, lets say Employee and Role defined as below and I have defined relationships in my database that gives me a list of objects say employees and thanks to my framework each employee object also has a Role object linked via the RoleIDID, UserName, Password, Email, RoleIDRoleID, RoleNameSo in code I can do something like this
I know how to bind a simple objects to a dropdown list. However I am having problems binding my objects which contains sub objects to the control.i.e. with simple object i just do ddl.DataValueField = "myproperty" with my objects they contains sub objects which i want to bind. I have tried ddl.DataValueField = "sub-object.myproperty" which doesnt work.
Save and retrieve MP3 Songs Audio files in SQL Server Database in C# while inserting the mp3 files into the database like gmail style we have to insert and display that songs in gridview
DESIGN pagemovie_name [TEXTBOX]//here user can enter movie name select_mp3 files [FILE UPLOAD CONTROL] //here user can attach multiple mp3 files like gmai [INSERT BUTTON]
i)page has to display movie names ,after clicking on the movie name that perticuler songs has to be display in gridview ?
How to upload file using fileupload control into sql database. I have class where i created insert function and getting info frm the .aspx.vb file ....
Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Text Imports System.Configuration Imports System.IO Imports System.Web.UI Imports System.Web.UI.WebControls Imports UTechBaseDLL Namespace VendorLib Public Class clsFilePan
firstly a static class only ever exists once and is not an instance. Any static members (ie static int NoOfPeople;) is stored in one place and is shared between all sessions (like the old global variables). Now static methods is where i'm not 100% sure. If I have a static method that doesn't use any other static members could this cause inconstant results, example (this is a fairly pointless method but just a quick example of the top of my head)
[Code]....
So in this example if two sessions (or threads) were to call this at the same time - would they both get back the expected results, because the method only uses private data (a, b and totalToReturn).Im sure this sounds a little simple but I will be using static methods to build user objects and various other objects that there will have to be a 100% garentee that the objects will not get mixed up between sessions and the wrong things return to the user.
I'm building an ASP.NET UserControl where users of the website can upload several pictures at once. I'm doing it the old fashioned way by letting the user enter the amount of FileUpload controls wanted and then add them dynamically from C# to a asp:Panel control.
While this works, the values/files from the FileUpload isn't stored for when the user clicks the "Save" button. How exactly do I go about this problem?
My code for specifying the amount of FileUpload controls wanted:
In my website,I have a home page in which by clicking on an image button,I get redirected to a different .apsx page .This page consists of a FileUpload control and 2 buttons(ATTACH,CANCEL).When a user selects/browses a file from his local machine and click ATTACH button,I display that file in a GRIDVIEW and also push the details of that file like Filename into a DATATABLE. The user in this way can browse multiple files and all of them are added to GridView and also pushed to DATATABLE.Now when the user clickes CANCEL button,I am sending the whole DATATABLE in a session object to the HOME page.Upon clicking SAVE button in the home page,the files in the DATATABLE must get stored in a physical location that I mention in the code. The problem that I am facing is that when I write
The files are not at all getting saved in the location. However If I pass the FileUpload control using Session from the second page,
FileUpload fl=(FileUpload)Session["FileUpload"]
The files are getting saved with the correct filenames but the content of all the files consists of the content of the latest uploaded file.I know what the problem is but unable to get a solution. My Requirement is to save the files in a physical path only after clicking the Save button in the home page.
When trying to generate rdp files on a web server with C#, when I try to save the rdp file it always fails with access denied. ASPNET and Network Services has full access, and even added EVERYONE as full permissions and it still won't save?
I have an app configured to use anonymous authentication, the application pool is set to network service. When I run filemonitor I can see that thw w3wp.exe is picking out the webpages and stuff from my hard drive and returning images etc. However one of the pages saves a file to a folder using c# save() method. Instead of the w3wp.exe actually writing the file to disk explorer.exe seems to be accessing the folder. What the hell is going on? I though the w3wp.exe did everything asp.net related why on earth is explorer.exe being introduced into the fold here?
I have a paper search facility, the results are displayed in a datagrid and what I want to do is have checkboxes for each record (which I've done) and then a button to download the selected papers.
My problem is that it didn't insert image name in database it save some unknown Characters in database. So when I want bind my image from database it didn't show image .
I'm having trouble with inserting the (Multiple)dynamically created FileUpload Files in database, since i'm using javascript to generate the function dynamically.
I want to upload .pdf or .doc files on server not in the Database, after then i have to show list of all the uploaded Files on another form and when user clicks on one of the Files, the file should be opened in new Tab...