I have a bit of a dilema, that maybe someone can give a reccomendation on. I have a vb app that will calculate a duration that a process runs in hours:minutes:seconds. My question is should I store this in the database as a date/time field or calculate total seconds and store it as an integer field? I will be using this field for basic summing calculations in the future. Thanks for any help.
I am storing xml in an xml datatype field in a table. But when I am generating physical file from the xml field, '&' in the xml field is getting converted into '&' in the physical file. But I want '&' to be intact.
Hello there,I just want to ask if storing data in dbase is much better than storing it in the file system? Because for one, i am currenlty developing my thesis which uploads a blob.doc file to a web server (currently i'm using the localhost of ASP.NET) then retrieves it from the local hostAlso i want to know if im right at this, the localhost of ASP.NET is the same as the one of a natural web server on the net? Because i'm just thinking of uploading and downloading the files from a web server. Although our thesis defense didn't require us to really upload it on the net, we were advised to use a localhost on our PC's. I'll be just using my local server Is it ok to just use a web server for storing files than a database?
I have a system that basically stores a database within a database (I'msure lots have you have done this before in some form or another).At the end of the day, I'm storing the actual data generically in acolumn of type nvarchar(4000), but I want to add support for unlimitedtext. I want to do this in a smart fashion. Right now I am leaningtowards putting 2 nullable Value fields:ValueLong ntext nullableValueShort nvarchar(4000) nullableand dynamically storing the info in one or the other depending on thesize. ASP.NET does this exact very thing in it's Session State model;look at the ASPStateTempSessions table. This table has both aSessionItemShort of type varbinary (7000) and a SessionItemLong of typeImage.My question is, is it better to user varbinary (7000) and Image? I'mthinking maybe I should go down this path, simply because ASP.NET does,but I don't really know why. Does anyone know what would be the benifitof using varbinary and Image datatypes? If it's just to allow saving ofbinary data, then I don't really need that right now (and I don't thinkASP.NET does either). Are there any other reasons?thanks,dave
best way to store questionnaire data in a database.Since different questionnairs have different questions and formats i.e dropdown, radio, checkboxes etc building such a database model becomes highly complex.
I've read that if data schema is complex and higly variable it may be better to use an xml document and store that in a databse. However I dont quite understand how you store xml to a database. Do you simply store the entire structure in something like a nvarchar column or is there some other way to store xml to a database.
If you store the entire structure to the databse then how do you query the content to generate reports.
Im currently storing an account id in a sql table. Is there any column data type that would presere the numbers but make it appear as a series of letters and nmumbers when someone looks at the database table?
Hi, can we keep a file like word file or html file in the sql server database? if yes, then can we search any thing in these stored file? regards mihir
hello ... i have a project this semester and i had to study is storing images in a database ( using Microsoft Access ) is good or bad ? so any one could tell me the advantages and the disadvantages please ... thanks bye
An odd question from me, I know, but this time, I assure you a twist.
I have a group that wants to store images in either a database or a file share, in order to make a certain website able to run on a load balanced web farm. These images are around 1KB each in size, and have a lifespan of exactly one use (think of graphs). I went a-googling, and found no shortage of articles that say "don't do it, but here's how you can do it", but I did not find any real hard statements as to why to not do it. Needless to say, this is hurting the case for not putting these images in the database. I have found an article that says images over 8KB will have worse performance, but I can not use that factoid here. For the moment, I have the developers leaning toward the fileshare, because they will be writing transaction logs all day, which will be more work than the fileshare needs to do....I think. The best I can do, is cut the text/image datatype overhead, and have them create the table as varbinary(2000), but even then, I don't like the look of the idea.
Anyone out there have good articles/whitepapers that detail the differences between writing single-use images to a fileshare vs. a SQL database? <baiting=blatant>Failing that, do any of the Microsoft development team have an opinion?</baiting>
Alternatively, what is the general opinion of keeping session state information in a database (because I bet that will be my next battle). I see .NET includes a session state server, but not being a programmer, I can not create an opbjective test.
Hy, could someone help me in this:In design mode, i want to put pictures in database. I made column namedpics, and its type as image. How can I put pictures or some address of thesepictures in that column, or i maybe need to put pictures in Add_Data folderand make reference from there, or what I need to do?could someone explain me that process of putting at least one picture indatabase, I'm using Microsoft SQL Server 2005thanks everyone
hi,I would like to store windows passwords and usernames in database.Please tell me where to start?What database can I use?Can I use free microsoft database?ThanksBart
Hey I currently have a foreach loop container working which scans a folder, loops through the files in this folder and then moves them to a new folder.
At the same time I also do an SQL insert into a table logging the details of the transfer.
What I would like to do next is to store the actual PDF in binary in my DB (varbinary format). How would I go about this ?
hi friends, i want to show images in repeater control dynamically. i want to store the image url in database like i have stored the images on onefolder c:images this will contain images how can i store and use the urls in database or atleast how can i show the images from the folder dynamically please help me out
Hi i am trying to store the checkbox values on my page to the database, but im stuck on what to do. I have the following code already;protected void Btn_Subscribe_Click(object sender, EventArgs e) {SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["streamConnectionString"].ConnectionString); string strSQL = "INSERT INTO Newsletter(emailAddress) VALUES (@emailAddress)";SqlCommand Command = new SqlCommand(strSQL, conn); Command.Parameters.Add("@emailAddress", SqlDbType.VarChar);Command.Parameters["@emailAddress"].Value = txtEmail.Text; conn.Open(); Command.ExecuteNonQuery(); conn.Close(); } How do i now insert the values from my checkbox, this is how i am setting the checkbox;public void Page_Load(object sender, EventArgs e) {ArrayList values;if(!IsPostBack) { //Build array of data to bind to checkboxlistvalues = new ArrayList(); values.Add("Sport");values.Add("Gardening");values.Add("technology"); AlertList.DataSource = values; AlertList.DataBind(); } If i am going about it the wrong way please let me know, thanks
Hi,I have a table which I need to store times in. What is the best way of doing this? The only way I can think of so far is to save the times as a datetime such as '1/1/1900 03:00 PM' then format the date as "hh:mm tt" so that the day isn't displayed. Is this the best method?Thanks,Curt.
I have records with 50 plus fields of data.I was thinking of writing all the fields data into a XML file and then store it in a SQL server database for retrieval later on.Is there anyway i can go about doing this?
Just a quick question to ask what is the best field to store the data held in a rich text box/control. Just want to make sure that i get it right first time you know. Not sure about the amount of characters that needs held but its going to be quite a lot as this field shall contain most of my pages content.
I am having a problem in a VB.NET application, i have a form that the user fills to store data in the database, the problem is that when i enter Arabic string, it gets stored in the database as question marks '??????' The database field type is nvarchar, anybody went across this problem?
What is the best approach for storing hierarchical data in a database? For example, if I need to store a tree menu system, how would I do that allowing for the most normalization within the database, using the least number of queries/resources when pulling the data out, and using the least amount of overhead both in storage and retrival?
I'm constructing an image gallery for my site and was wondering how to store the pictures in the database? Would the best way to do it, by storing the link instead of the image in the database?
How would I use the insert and select with it? :confused:
Which is better, to store the files onto the server's folders or to a database? I tried storing to MSSQL 2000 but the varbinary does not allow me to set "MAX" for the data type.
Hey all, I have a form in one page and when the user clicks the submit button it has to save the data into my SQL database which i have created.It doesnt show any error and it successfully redirects to another page but not saving the data .Could someone help please.Here is my code under submit button SqlDataSource txtDataSource = new SqlDataSource(); txtDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["LocalSqlServer"].ToString(); txtDataSource.InsertCommandType = SqlDataSourceCommandType.Text; txtDataSource.InsertCommand = "INSERT INTO Hamburgdata(user_name, report_type, company_name , street_address, city, state, zip_code, tax_ID) VALUES (@user_name,@report_type,@company_name ,@street_address,@city,@state,@zip_code,@Tax_ID)"; txtDataSource.InsertParameters.Add("user_name", User.Identity.Name); txtDataSource.InsertParameters.Add("report_type", ReportType.Text); txtDataSource.InsertParameters.Add("company_name", CompanyName.Text); txtDataSource.InsertParameters.Add("street_address", StreetAddress.Text); txtDataSource.InsertParameters.Add("city", City.Text); txtDataSource.InsertParameters.Add("state", State.Text); txtDataSource.InsertParameters.Add("zip_code", ZipCode.Text); txtDataSource.InsertParameters.Add("tax_ID", TaxID.Text); int rowAffected = 0; try { rowAffected = txtDataSource.Insert(); } catch (Exception exp) { } finally { txtDataSource = null; } } ThanksVik
Hi There,Being quite new to MS-SQL I would like to ask if there is a general opinionof what approach should be taken to storing things like external documentsand images in databases.Should the actual files be stored within the database, or instead shouldlinks to the files on a file server or something similar be stored instead.For the end user I imagine it is easier to have everything stored within thedatabase, because doing it the other way in effect gives another level ofmanagement because there is the need to perhaps manually look after the fileserver with all the image files or document files on.In my particular case, I am building a database where the users use a greatmany Word documents. For example, I particular record might have a number ofdifferent Word documents associated with it.I was going to create a "Documents" table that all documents were stored in(including meta data about each document because it will be really useful tobe able to search for documents so that they can be reused).In this table I was in a dilemma as to whether to actually store thedocuments in the table. Other then the performance hit and memoryrequirements this will require, are there any other disadvantages?What are the general thoughts when a database needs to manage a lot of pdfand word documents?Thanks in advance.Dave.
hi in my front end i have one text area where user can input his sql statements. for samller data its working. the data type of coulmn is Text in sql server 2005. but problem is when i try to store this data its showing error.i meant not storing data at all. if i cut some of line from this then in this case it stores the data .what should i do to overcome this problem
thanx a lot.
DECLARE @sTemp VARCHAR(10) DECLARE @nMemberID INT DECLARE @nPartnerID INT DECLARE @nDocumentTypeNo INT DECLARE @nDocumentFormat INT DECLARE @sEmailAddress VARCHAR(200) SET @sTemp = '{*MEMBERID*}' IF UPPER(@sTemp) = 'NULL' SET @nMemberID = NULL ELSE SET @nMemberID = CAST(@sTemp AS INT) SET @sTemp = '{*PARTNERID*}' IF UPPER(@sTemp) = 'NULL' SET @nPartnerID = NULL ELSE SET @nPartnerID = CAST(@sTemp AS INT) SET @sTemp = '{*DOCUMENTTYPENO*}' IF UPPER(@sTemp) = 'NULL' SET @nDocumentTypeNo = NULL ELSE SET @nDocumentTypeNo = CAST(@sTemp AS INT) SET @sTemp = '{*DOCUMENTFORMAT*}' IF UPPER(@sTemp) = 'NULL' SET @nDocumentFormat = NULL ELSE SET @nDocumentFormat = CAST(@sTemp AS INT) SET @sEmailAddress = '{*EMAILADDRESS*}' IF EXISTS(SELECT * FROM ProtocolSettings WHERE ((@nMemberID IS NULL AND MemberID IS NULL) OR MemberID = @nMemberID) AND ((@nPartnerID IS NULL AND PartnerID IS NULL) OR PartnerID = @nPartnerID) AND ((@nDocumentTypeNo IS NULL AND DocumentTypeNo IS NULL) OR DocumentTypeNo = @nDocumentTypeNo) AND ((@nDocumentFormat IS NULL AND DocumentFormatNo IS NULL) OR DocumentFormatNo = @nDocumentFormat) AND ProtocolSettingNo = 307) BEGIN UPDATE ProtocolSettings SET SettingValue = @sEmailAddress WHERE ((@nMemberID IS NULL AND MemberID IS NULL) OR MemberID = @nMemberID) AND ((@nPartnerID IS NULL AND PartnerID IS NULL) OR PartnerID = @nPartnerID) AND ((@nDocumentTypeNo IS NULL AND DocumentTypeNo IS NULL) OR DocumentTypeNo = @nDocumentTypeNo) AND ((@nDocumentFormat IS NULL AND DocumentFormatNo IS NULL) OR DocumentFormatNo = @nDocumentFormat) AND ProtocolSettingNo = 307 END ELSE BEGIN INSERT INTO ProtocolSettings (ProtocolSettingNo, MemberID, PartnerID, DocumentTypeNo, DocumentFormatNo, SettingValue) VALUES(307, @nMemberID, @nPartnerID, @nDocumentTypeNo, @nDocumentFormat, @sEmailAddress) END