Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 423
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 423
Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 426 ASP.Net - The Scripts Library CommunityFree programming tutorial and source code for beginners and professionalhttp://www.scriptslibrary.net/aspnet2010-09-06T20:29:16ZJoomla! 1.5 - Open Source Content ManagementCreate Hit Counter using C#2009-06-19T21:44:19Z2009-06-19T21:44:19Zhttp://www.scriptslibrary.net/aspnet/93-create-hit-counter-using-cFeraspayment@lebmailer.comA simple Hit Counter function that will count how many visitors your website has reached. This function uses the StreamReader to read from a text file located in the root folder of your application, adn the StreamWriter to write into this file.<br /><br /> First, create a text file, name it as txtcounter.txt, and place it in the root folder or your application. <br /> The GetStat() function will return the latest updated from the text file, and write new stat to it:<br />A simple Hit Counter function that will count how many visitors your website has reached. This function uses the StreamReader to read from a text file located in the root folder of your application, adn the StreamWriter to write into this file.<br /><br /> First, create a text file, name it as txtcounter.txt, and place it in the root folder or your application. <br /> The GetStat() function will return the latest updated from the text file, and write new stat to it:<br />Upload Microsoft Word file using ASP.NET2009-06-15T00:23:42Z2009-06-15T00:23:42Zhttp://www.scriptslibrary.net/aspnet/81-upload-microsoft-word-file-using-aspnetFerasferasc@hotmail.comNormal 0 <p> Normal 0 </p><p>This function allows you to <strong>upload a Microsoft Word file</strong> and put it on the server using ASP.NET.</p> Normal 0 Add the following controls to the aspx file, inside a form tag:<br />Normal 0 <p> Normal 0 </p><p>This function allows you to <strong>upload a Microsoft Word file</strong> and put it on the server using ASP.NET.</p> Normal 0 Add the following controls to the aspx file, inside a form tag:<br />Read Write With Cookies Using C#2008-09-13T21:26:41Z2008-09-13T21:26:41Zhttp://www.scriptslibrary.net/aspnet/57-read-write-with-cookies-using-cAdministratorinfo@scriptslibrary.net<br /><p class="caption">Cookies are widely used in majority of web applications. They are used in login forms, shopping cart, or simply to track users. This example demonstrates how to write, read values using a cookie using C#. </p><p>{CODE brush: cpp;} <br /> //To Write to a cookie <br /><br /> HttpCookie userCookie;<br /> UserName="admin";<br /> userCookie = new HttpCookie("UserName") ;<br /> cookie.Values.Add(UserName, UserName) ;<br /> Response.Cookies.Add(userCookie);<br /> <br /> // To read from a cookie <br /> <br /> HttpCookie userCookie; <br /> userCookie = Request.Cookies["UserName"]; <br /> String UserName = userCookie.Value; <br />{/CODE}</p><p>That's it!</p><br /><p class="caption">Cookies are widely used in majority of web applications. They are used in login forms, shopping cart, or simply to track users. This example demonstrates how to write, read values using a cookie using C#. </p><p>{CODE brush: cpp;} <br /> //To Write to a cookie <br /><br /> HttpCookie userCookie;<br /> UserName="admin";<br /> userCookie = new HttpCookie("UserName") ;<br /> cookie.Values.Add(UserName, UserName) ;<br /> Response.Cookies.Add(userCookie);<br /> <br /> // To read from a cookie <br /> <br /> HttpCookie userCookie; <br /> userCookie = Request.Cookies["UserName"]; <br /> String UserName = userCookie.Value; <br />{/CODE}</p><p>That's it!</p>Using parameters with MS Access2008-09-06T22:05:23Z2008-09-06T22:05:23Zhttp://www.scriptslibrary.net/aspnet/53-using-parameters-with-ms-accessAdministratorinfo@scriptslibrary.net<p>This example illustrates the usage of parameters in asp.net with MS Access. It’s a simple sub that takes one parameter, first name, and print the Last name on the page. </p>{CODE brush: vb;} <br /><%@ Import Namespace="System.Data" %> <br /><br /><%@ Import Namespace="System.Data.OleDb" %> <br /><br /> <br /><br />Sub Print_Last_Name (First_Name as string) <br /><br />Dim conn As OleDbConnection <br /><br />Dim strLastName As String <br /><br />Dim cmd As OleDbCommand <br /><br />conn = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=c:\users.mdb" ) <br /><br />strLastName = "Select LastName From users Where FirstName=? " <br /><br />cmd = New OleDbCommand( strLastName, conn ) <br /><br />cmd.Parameters.Add( "@firstname", First_Name ) <br /><br /><br /><br />conn.Open () <br /><br />Response.write ("<strong>Home Phone Is</strong> " & cmd. ExecuteScalar () <br /><br /><br /><br />conn.Close () <br /><br />End Sub <br />{/CODE}<p>This example illustrates the usage of parameters in asp.net with MS Access. It’s a simple sub that takes one parameter, first name, and print the Last name on the page. </p>{CODE brush: vb;} <br /><%@ Import Namespace="System.Data" %> <br /><br /><%@ Import Namespace="System.Data.OleDb" %> <br /><br /> <br /><br />Sub Print_Last_Name (First_Name as string) <br /><br />Dim conn As OleDbConnection <br /><br />Dim strLastName As String <br /><br />Dim cmd As OleDbCommand <br /><br />conn = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=c:\users.mdb" ) <br /><br />strLastName = "Select LastName From users Where FirstName=? " <br /><br />cmd = New OleDbCommand( strLastName, conn ) <br /><br />cmd.Parameters.Add( "@firstname", First_Name ) <br /><br /><br /><br />conn.Open () <br /><br />Response.write ("<strong>Home Phone Is</strong> " & cmd. ExecuteScalar () <br /><br /><br /><br />conn.Close () <br /><br />End Sub <br />{/CODE}Connect ASP.Net to MySQL database2008-09-06T18:57:26Z2008-09-06T18:57:26Zhttp://www.scriptslibrary.net/aspnet/52-connect-aspnet-to-mysql-databaseFerasferasc@hotmail.com<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:DoNotOptimizeForBrowser/> </w:WordDocument> </xml><![endif]--> <!-- /* Font Definitions */ @font-face {font-family:"Arial Unicode MS"; panose-1:2 11 6 4 2 2 2 2 2 4; mso-font-charset:128; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1 -369098753 63 0 4129279 0;} @font-face {font-family:"\@Arial Unicode MS"; panose-1:2 11 6 4 2 2 2 2 2 4; mso-font-charset:128; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1 -369098753 63 0 4129279 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} pre {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Arial Unicode MS";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> <p class="MsoNormal"> </p><p class="MsoNormal">MySql is a free open-source database server. Thus, many people would like to use it with in <br />ASP.Net pages to cut the cost of their projects. </p> <p class="MsoNormal">It’s pretty easy to connect ASP.Net pages to MySQL database. First you have to have MySQL<br /> database and the MySQL ODBC Driver.</p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:DoNotOptimizeForBrowser/> </w:WordDocument> </xml><![endif]--> <!-- /* Font Definitions */ @font-face {font-family:"Arial Unicode MS"; panose-1:2 11 6 4 2 2 2 2 2 4; mso-font-charset:128; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1 -369098753 63 0 4129279 0;} @font-face {font-family:"\@Arial Unicode MS"; panose-1:2 11 6 4 2 2 2 2 2 4; mso-font-charset:128; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1 -369098753 63 0 4129279 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} pre {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Arial Unicode MS";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> <p class="MsoNormal"> </p><p class="MsoNormal">MySql is a free open-source database server. Thus, many people would like to use it with in <br />ASP.Net pages to cut the cost of their projects. </p> <p class="MsoNormal">It’s pretty easy to connect ASP.Net pages to MySQL database. First you have to have MySQL<br /> database and the MySQL ODBC Driver.</p>