|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASP.net webpage and databaseHello, I have an ASP.net webpage and I would like to include many articles
about trees. I though about creating a SQL server database and bind it to my ASP.net webpage. I know how to bind a database to ASP.net but I don't know if it is a good idea to store the articles in my database as binary data (I think it would be more efficient if I only store a pointer to it). What do you think? XML maybe? I need examples because I'm a beginner. My intention is that the ASP.net page receives a parameter (say "ArticleID?=12345") and then loads the 12345 article from the database. Thanks, On Jul 9, 3:58 am, "Beginner" <n...@spam.com> wrote: This is a regular approach for all database-driven websites.> My intention is that the ASP.net page receives a parameter (say > "ArticleID?=12345") and then loads the 12345 article from the database. > "Beginner" <no@spam.com> wrote in message Sounds OK to me...news:uOecEjDAKHA.1380@TK2MSFTNGP02.phx.gbl... > My intention is that the ASP.net page receives a parameter (say > "ArticleID?=12345") and then loads the 12345 article from the database. > Sounds OK to me... And should I store the articles as binary data in the database or should I store them elsewere? If you have links with code examples, I'd be grateful. Thanks, Show quoteHide quote "Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message news:uLA5foHAKHA.4004@TK2MSFTNGP05.phx.gbl... > "Beginner" <no@spam.com> wrote in message > news:uOecEjDAKHA.1380@TK2MSFTNGP02.phx.gbl... > >> My intention is that the ASP.net page receives a parameter (say >> "ArticleID?=12345") and then loads the 12345 article from the database. > > > > -- > Mark Rae > ASP.NET MVP > http://www.markrae.net
Show quote
Hide quote
On Jul 9, 1:57 pm, "Beginner" <n...@spam.com> wrote: Create a table Articles> > Sounds OK to me... > > And should I store the articles as binary data in the database or should I > store them elsewere? > > If you have links with code examples, I'd be grateful. > > Thanks, > > "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote in messagenews:uLA5foHAKHA.4***@TK2MSFTNGP05.phx.gbl... > > > > > "Beginner" <n...@spam.com> wrote in message > >news:uOecEjDAKHA.1380@TK2MSFTNGP02.phx.gbl... > > >> My intention is that the ASP.net page receives a parameter (say > >> "ArticleID?=12345") and then loads the 12345 article from the database. > > > -- > > Mark Rae > > ASP.NET MVP > >http://www.markrae.net- Hide quoted text - > > - Show quoted text - Id int (as an identity column) Text nvarchar(max) then to insert data use string text = "...text here...."; SqlConnection DataConnection = new SqlConnection(Connection); string Command = "INSERT INTO Articles VALUES (@Text)"; SQLCommand DataCommand = new SqlCommand(Command, DataConnection); DataCommand.Parameters.AddWithValue("@Text", text); DataCommand.Connection.Open(); DataCommand.ExecuteNonQuery(); DataCommand.Connection.Close(); See more on MSDN or ASP.NET: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/default.aspx Hope this helps Hi,
I would say that the formatting of the articles would dictate your method. Do you need to maintain fonts and pictures? If so, storing the articles as PDFs on the server, then referencing their ID in the database to grab the location/file name then display accordingly. If you want to go this way, I could cobble some psuedo code together for you. If you just need the text, then a nvarchar() in the table will do the trick. Craig Show quoteHide quote "Beginner" <no@spam.com> wrote in message news:eIXipxIAKHA.1340@TK2MSFTNGP05.phx.gbl... >> Sounds OK to me... > > And should I store the articles as binary data in the database or should I > store them elsewere? > > If you have links with code examples, I'd be grateful. > > Thanks, > > "Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message > news:uLA5foHAKHA.4004@TK2MSFTNGP05.phx.gbl... >> "Beginner" <no@spam.com> wrote in message >> news:uOecEjDAKHA.1380@TK2MSFTNGP02.phx.gbl... >> >>> My intention is that the ASP.net page receives a parameter (say >>> "ArticleID?=12345") and then loads the 12345 article from the database. >> > >> >> >> -- >> Mark Rae >> ASP.NET MVP >> http://www.markrae.net >
Other interesting topics
autoincrement vs uniqueidentifier (easy)
Is Delegation Necessary? session state time out Using if on ASPX-side instead of in code behind restrict number of users á ÇáÅÓáÇã Úä ÇáÅÑåÇÈ¿ Redirect To Login Page - Forms Authentication Urgent - Issues with using Office 2003 PIA on Windows Server 2008 Trap Data Tier Errors? American and European Converted from Christianity to ISLAM |
|||||||||||||||||||||||