ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2017 www.aspforums.com. All rights reserved.What Data type we need to use to store binary files data in MySQL<p><span class="hps">hi</span> <span class="hps">all</span> <span class="hps">masters</span> <span class="hps">asp.net</span><br /><span class="hps">I</span> <span class="hps">use</span> <span class="hps">mysql database</span>, <span class="hps">to</span> <span class="hps">save</span> <span class="hps">a word file</span>, <span class="hps">pdf</span> <span class="hps">her</span> <span class="hps">what</span> <span class="hps">data types</span>? <span class="hps">if</span> <span class="hps">in</span> <span class="hps">sqlserver</span> <span class="hps">2005</span> <span class="hps">=</span> <span class="hps">varbinary</span> <span class="hps atn">(</span>max) <span class="hps">if the</span> <span class="hps">mysql</span> <span class="hps">what</span>?</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/101030/What-Data-type-we-need-to-use-to-store-binary-files-data-in-MySQL/http://www.aspforums.net/Threads/101030/What-Data-type-we-need-to-use-to-store-binary-files-data-in-MySQL/Mon, 17 Nov 2014 02:10:43 GMTUsing LINQ with MySQL in C#<p>sir,</p> <p>I used ur code while developing some of my modules and they work fantastic...now i have a prob was working on that from last week bt unable to correct it can u plz help m out??</p> <p>I have a textbox under that i have taken a checkbox that is giving input in form of 1 or 0</p> <p>and under that i have taken a gridview in which my column name is ID,name and Ismain with a radiobutton what i want is that when i select checkbox the ismain should give value 1 or 0 else when i select radiobutton &nbsp;Ismain should give the same value as Id....</p> <p>hope to have a positive rply from ur side...</p> <p>thanks in advance..</p> <p>i have done this using linq..This is what i have done till nw&nbsp;</p> <pre class="brush: csharp">public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { fillgrid(); } } protected void btnsub_Click(object sender, EventArgs e) { masterdataDataContext db = new masterdataDataContext(); { string name = txtname.Text.ToString(); int IsMain = Convert.ToInt32(Chckmain.Checked); int checkBoxVal; if (Chckmain.Checked) { checkBoxVal = 1; } db.getdata(name, IsMain); db.SubmitChanges(); fillgrid(); } } protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { fillgrid(); } public void fillgrid() { masterdataDataContext db = new masterdataDataContext(); var categories = db.getalldata(); GridView1.DataSource = categories.ToList(); GridView1.DataBind(); } }</pre> <p></p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/146182/Using-LINQ-with-MySQL-in-C/http://www.aspforums.net/Threads/146182/Using-LINQ-with-MySQL-in-C/Sat, 06 Oct 2012 06:12:26 GMTupload image to mysqldatabase using ajaxfileupload control in ASP.Net<p>is there any Tutorial on how to upload image into mysqldatabase using ajaxfileupload?</p>http://www.aspforums.net/Threads/140572/upload-image-to-mysqldatabase-using-ajaxfileupload-control-in-ASPNet/http://www.aspforums.net/Threads/140572/upload-image-to-mysqldatabase-using-ajaxfileupload-control-in-ASPNet/Mon, 25 Jul 2016 02:03:19 GMTSave and Retrieve files from MySQL Database in ASP.Net<p>code for retriving &nbsp;image in mysql database. image logblob...</p> <p>asp.net</p>http://www.aspforums.net/Threads/765476/Save-and-Retrieve-files-from-MySQL-Database-in-ASPNet/http://www.aspforums.net/Threads/765476/Save-and-Retrieve-files-from-MySQL-Database-in-ASPNet/Thu, 28 Aug 2014 03:11:03 GMTRussian characters are not displaying on page with MySQL Database in aSP.Net<p>Hi,</p> <p>i am trying to insert russian language from asp.net front end into database.But when i insert <strong>?</strong> are going into database.Similarly if i insert into database from backend it is showing fine in database but when i fetch same record using select query from asp.net page it is showing<strong>?</strong>.</p> <p>How to solve this issue(utf-8) for asp.net.</p> <p>Thanks</p> <p>Rajeev Punhani</p>http://www.aspforums.net/Threads/576595/Russian-characters-are-not-displaying-on-page-with-MySQL-Database-in-aSPNet/http://www.aspforums.net/Threads/576595/Russian-characters-are-not-displaying-on-page-with-MySQL-Database-in-aSPNet/Wed, 20 Mar 2013 02:50:32 GMTResources for getting started with MySql in ASP.Net<p>What resources are available to help me get started with MySQL?</p>http://www.aspforums.net/Threads/437426/Resources-for-getting-started-with-MySql-in-ASPNet/http://www.aspforums.net/Threads/437426/Resources-for-getting-started-with-MySql-in-ASPNet/Thu, 06 Aug 2015 07:44:33 GMTUnable to perform Date Filter in MySQL Database when date stored in VARCHAR column<p>MySQL's default DATE field format is "YYYY-MM-DD".<br /><br />But in my one of the MYSQL DB Table (in which Data is coming from other service) Date is stored in Format "DD/MM/YYYY"</p> <p>i.e., 24/03/2014<br /><br />which creates problem when I Filter the data of that Table using DATE filter in My Web page.<br /><br /><br />There is a web page in which a Textbox , Button , and Grid is there.<br />When I choose Data in Textbox(using ajax calander) and click on button, related DATE data should show in Grid.<br /><br />Since the Date format is not correct in DB table, it do not filter any data.<br /><br /></p> <p><strong>HTML code:</strong></p> <p>&nbsp;</p> <pre class="brush: html">&lt;asp:TextBox ID=&#34;TFDate&#34; runat=&#34;server&#34; Width=&#34;40%&#34;&gt;&lt;/asp:TextBox&gt; &lt;cc1:CalendarExtender ID=&#34;CalendarExtender1&#34; runat=&#34;server&#34; Enabled=&#34;True&#34; Format=&#34;dd-MM-yyyy&#34; TargetControlID=&#34;TFDate&#34;&gt;&lt;/cc1:CalendarExtender&gt; &lt;asp:Button ID=&#34;Bshow&#34; runat=&#34;Server&#34; Text=&#34;Show Report&#34; OnClick=&#34;Bshow_Click1&#34;/&gt; //Also, Gridview</pre> <p>Please suggest some way how to solve this problem while doing DATE filter. Because I can not change the date format which is coming in DB Table.<br /><br />Please reply.</p>http://www.aspforums.net/Threads/270530/Unable-to-perform-Date-Filter-in-MySQL-Database-when-date-stored-in-VARCHAR-column/http://www.aspforums.net/Threads/270530/Unable-to-perform-Date-Filter-in-MySQL-Database-when-date-stored-in-VARCHAR-column/Tue, 15 Apr 2014 23:34:10 GMTTo Display records in the data base by keeping a column id as distinct<p>Hi.....</p> <p>plase suggest me a way solve a query to display records in the My SQL server database such that keeping a a column id value as distinct.</p> <p>Query type: LINQ or Lambda Expressions.</p> <p>database: my sql</p> <p>technology:C# asp.net Mvc3 application</p> <p>Thankyou,</p> <p>Ruqsana.&nbsp;</p>http://www.aspforums.net/Threads/116333/To-Display-records-in-the-data-base-by-keeping-a-column-id-as-distinct/http://www.aspforums.net/Threads/116333/To-Display-records-in-the-data-base-by-keeping-a-column-id-as-distinct/Sat, 01 Sep 2012 06:22:16 GMTSyntax error in MySQL Query in C# .Net<p>I am writing a code where query is like:</p> <p>select *from users where username!='ABC';</p> <p>but when i write it in c# code as</p> <p>string excludedname="abc";</p> <p>string query="select *from users where username !='"+excludedname+"'";</p> <p>its giving error in syntax what is the correct way to do this??</p>http://www.aspforums.net/Threads/168426/Syntax-error-in-MySQL-Query-in-C-Net/http://www.aspforums.net/Threads/168426/Syntax-error-in-MySQL-Query-in-C-Net/Fri, 07 Feb 2014 02:18:38 GMTSUM of Multiple columns of MySQL table<p>NAME &nbsp;X &nbsp; &nbsp;Y<br />A &nbsp; &nbsp; &nbsp; 10 &nbsp;20</p> <p>B &nbsp; &nbsp; &nbsp; &nbsp;12 &nbsp;24&nbsp;</p> <p>C &nbsp; &nbsp; &nbsp; &nbsp;15 &nbsp;22&nbsp;</p> <p>D &nbsp; &nbsp; &nbsp; &nbsp; 18 &nbsp;9<br /><br />i want to get name of students group by their total marks in desc order</p>http://www.aspforums.net/Threads/335604/SUM-of-Multiple-columns-of-MySQL-table/http://www.aspforums.net/Threads/335604/SUM-of-Multiple-columns-of-MySQL-table/Fri, 27 Jun 2014 04:01:55 GMTStore image in MySQL using ASP.Net<p>I just want to scan image and store in a data base&nbsp;</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/195406/Store-image-in-MySQL-using-ASPNet/http://www.aspforums.net/Threads/195406/Store-image-in-MySQL-using-ASPNet/Thu, 08 Nov 2012 00:09:18 GMTShow Custom Error message when Foreign Key Violation error occurs in C# .Net<p>I am using VS2010 and Sql Server 2000. There are two tables referenced by foreign key and I am not allowing Master record to be deleted, if record is present in child table. The scenario is working fine, but the problem is that&nbsp;when user will try to delete the record, I want to show custom error message to the user instead of sql exception. How can I do tha?</p>http://www.aspforums.net/Threads/103453/Show-Custom-Error-message-when-Foreign-Key-Violation-error-occurs-in-C-Net/http://www.aspforums.net/Threads/103453/Show-Custom-Error-message-when-Foreign-Key-Violation-error-occurs-in-C-Net/Mon, 11 May 2015 07:48:13 GMTSave date in ddMMyyyy format in MySQL Database in ASP.Net C#<p>i need to get some values from Mysql Db. i have passed some values to mysql and get the result.how to pass date format in &nbsp;MySql from Asp.net C# code.</p>http://www.aspforums.net/Threads/355971/Save-date-in-ddMMyyyy-format-in-MySQL-Database-in-ASPNet-C/http://www.aspforums.net/Threads/355971/Save-date-in-ddMMyyyy-format-in-MySQL-Database-in-ASPNet-C/Sat, 15 Feb 2014 00:10:39 GMTSave and Retrieve Image files with Path saved in MySql Database and Image File in folder in ASP.Net<p>hi all help me</p> <p>i want three fileupload</p> <p>this my table&nbsp;,&nbsp; datbase mysql</p> <p>id&nbsp;&nbsp;&nbsp; int</p> <p>name varchar (30)</p> <p>file_regulation1 varchar(100)</p> <p>file_regulation2 varchar(100)</p> <p>file_regulation3 varchar(100)</p> <p>&nbsp;</p> <p>i m saving file in folder/path</p>http://www.aspforums.net/Threads/150113/Save-and-Retrieve-Image-files-with-Path-saved-in-MySql-Database-and-Image-File-in-folder-in-ASPNet/http://www.aspforums.net/Threads/150113/Save-and-Retrieve-Image-files-with-Path-saved-in-MySql-Database-and-Image-File-in-folder-in-ASPNet/Thu, 29 Jan 2015 01:40:53 GMTRead XML File and get the values using C#<p>I have this code to read XML file</p> <pre class="brush: xml">var fileName = &#34;D:\\info1.xml&#34;; XDocument doc = XDocument.Load(fileName); var col = from dummy in doc.DescendantNodes() select dummy; foreach (var myvar in col) { //Get the code and description here }</pre> <p>The XML file has this element? how can I get the value of code and desc?</p> <p><strong>&lt;maritalStatus code="M" desc="Married"&gt;</strong></p>http://www.aspforums.net/Threads/128935/Read-XML-File-and-get-the-values-using-C/http://www.aspforums.net/Threads/128935/Read-XML-File-and-get-the-values-using-C/Tue, 23 Aug 2016 10:06:04 GMTRead values from XML File and save in MySQL Database using C#<p>how to splite lat and lon from xml file and store into mysql database.</p> <p>plz reply as early as possiable.</p>http://www.aspforums.net/Threads/211892/Read-values-from-XML-File-and-save-in-MySQL-Database-using-C/http://www.aspforums.net/Threads/211892/Read-values-from-XML-File-and-save-in-MySQL-Database-using-C/Mon, 13 May 2013 01:33:53 GMTPopulate ASP.Net GridView with MySQL Database<p>how to create grid view for mysql data base?</p>http://www.aspforums.net/Threads/773598/Populate-ASPNet-GridView-with-MySQL-Database/http://www.aspforums.net/Threads/773598/Populate-ASPNet-GridView-with-MySQL-Database/Thu, 01 Nov 2012 04:43:12 GMTMySQL Update Query not working and not updating records<p>I have a table</p> <p>stu_id,stu_name,stu_age the first stu_id is auto increment column ..</p> <p>1 nnnnnn 25</p> <p>2 sssssss 23</p> <p>3 vail &nbsp; &nbsp; &nbsp; 22</p> <p>&nbsp; Code:</p> <pre class="brush: csharp">OleDbCommand cmd = new OleDbCommand(&#34;update bannerdetails set bannername=&#39;&#34; + textslidename.Text + &#34;&#39;,bannerimage=&#39;&#34; + upload.PostedFile.FileName + &#34;&#39;,bannerlink=&#39;&#34; + textslideurl.Text + &#34;&#39; where id=&#34; + userid + &#34;&#34;, conn);</pre> <p>now i want to update the ssssss for 4 ...if u anty idea pls give me..</p>http://www.aspforums.net/Threads/298417/MySQL-Update-Query-not-working-and-not-updating-records/http://www.aspforums.net/Threads/298417/MySQL-Update-Query-not-working-and-not-updating-records/Sun, 06 Apr 2014 03:01:10 GMTMySQL Stored Procedure for searching in Table<p>how to create procedure search string in mysql</p> <p>&nbsp;</p> <p>&nbsp;</p> <pre class="brush: csharp">DELIMITER $$ USE `dbcoba`$$ DROP PROCEDURE IF EXISTS `carii`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `carii`(IN id_lembaga INT) BEGIN SELECT l.id_lembaga,p.propinsi_nama,k.kabupaten_nama,l.nama_lembaga,pr.peraturan_terkait FROM tbl_nama_lembaga l JOIN tbl_peraturan pr ON pr.id_peraturan=l.id_peraturan JOIN tbl_kabupaten k ON k.kabupaten_id=pr.kabupaten_id JOIN tbl_propinsi p ON p.propinsi_id=k.propinsi_id JOIN tbl_sektor sek ON sek.sektor_id=pr.sektor_id JOIN tbl_type_perda ty ON ty.type_id=pr.type_id WHERE l.id_lembaga=id_lembaga; END$$ DELIMITER ;</pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/396534/MySQL-Stored-Procedure-for-searching-in-Table/http://www.aspforums.net/Threads/396534/MySQL-Stored-Procedure-for-searching-in-Table/Wed, 25 Mar 2015 04:49:21 GMTMySQL Query to get names of all Tables in Database<p>MySql query to get all table names of a database in asp.net</p>http://www.aspforums.net/Threads/772680/MySQL-Query-to-get-names-of-all-Tables-in-Database/http://www.aspforums.net/Threads/772680/MySQL-Query-to-get-names-of-all-Tables-in-Database/Sun, 24 Nov 2013 18:44:47 GMTMysql query<p>@ mudassar , @ashusingh</p> <p>I have an "Id" filed in MySqlDB "sensor_info"table, based on this id, i have to execute a query for: select the MAX id and display related messages on label according to that maximum id.</p> <p>how to get this using DataManager in Mysql.</p> <p>here is my query:-</p> <p>string query2 = "select MAX(Id) from sensor_info";</p> <p>now how i display message on label according to above "Id"(i have to choose max id) which is coming from database.</p> <p>please reply.</p>http://www.aspforums.net/Threads/142044/Mysql-query/http://www.aspforums.net/Threads/142044/Mysql-query/Thu, 25 Jul 2013 04:35:15 GMTMySQL ERROR : column EnquiryNo cannot be null<p>i have a stored procedure in Mysql while i execute the procedure i get this error even am having the values in the query.</p> <pre class="brush: sql">CALL sptblEnquiryMaster (&#39;Offer/0011/2013-2014&#39;,&#39;demo/001&#39;,&#39;2014&#39;,&#39;1&#39;,&#39;1&#39;,&#39;0&#39;,&#39;1&#39;,&#39;1&#39;,&#39;1&#39;,&#39;jkn&#39;,&#39;jkn&#39;,&#39;nn&#39;,&#39;1&#39;, &#39;1&#39;,&#39;ADD&#39;,&#39;hjbj&#39;,@PMasterSID)</pre> <p>ERROR : column 'EnquiryNo ' cannot be null&nbsp;</p>http://www.aspforums.net/Threads/262074/MySQL-ERROR-column-EnquiryNo-cannot-be-null/http://www.aspforums.net/Threads/262074/MySQL-ERROR-column-EnquiryNo-cannot-be-null/Wed, 12 Feb 2014 23:15:44 GMTImport data from Excel sheet to MySQL database in ASP.Net<p>how to code the excel sheet in mysql database serever pls can i explain with any example.&nbsp;</p>http://www.aspforums.net/Threads/329924/Import-data-from-Excel-sheet-to-MySQL-database-in-ASPNet/http://www.aspforums.net/Threads/329924/Import-data-from-Excel-sheet-to-MySQL-database-in-ASPNet/Mon, 08 Sep 2014 03:00:43 GMTMySQL check if record exist then update else insert<p>hi.. i am working with vb.net, I try to find the solution for "if exist update else insert" however I could'nt find any suitable with vb.net. Can anyone help?&nbsp;</p> <p>2 or more tables will be affected when I click save button.&nbsp;</p> <p>1st. It will insert data in order_list (parent table) where order_no is the primary key.&nbsp;</p> <p>&nbsp;</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>-----------------------------------------------</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>order_no | &nbsp; From<span class="Apple-tab-span" style="white-space: pre;"> </span>&nbsp; | <span class="Apple-tab-span" style="white-space: pre;"> </span>To</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>-----------------------------------------------</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>wo_01 &nbsp; &nbsp;&nbsp;| &nbsp; &nbsp;W &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp;JAT</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>wo_02<span class="Apple-tab-span" style="white-space: pre;"> </span>| &nbsp; &nbsp;x<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>&nbsp; | &nbsp; &nbsp;JAB</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>wo_03<span class="Apple-tab-span" style="white-space: pre;"> </span>| &nbsp; &nbsp;Y<span class="Apple-tab-span" style="white-space: pre;"> </span>&nbsp; | &nbsp; &nbsp;STU&nbsp;</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>------------------------------------------------</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>2nd. It will insert data details in order_list_details (child table) table. &nbsp;order_no with different products. eg:&nbsp;</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>-----------------------------------------------</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>order_no | Product_id| Product_type</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>-----------------------------------------------</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>wo_01 &nbsp; &nbsp;&nbsp;| &nbsp; A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp;A_A1</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>wo_01<span class="Apple-tab-span" style="white-space: pre;"> </span>| &nbsp; A<span class="Apple-tab-span" style="white-space: pre;"> </span>&nbsp; | &nbsp; &nbsp;A_A2</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>wo_01<span class="Apple-tab-span" style="white-space: pre;"> </span>| &nbsp; B<span class="Apple-tab-span" style="white-space: pre;"> </span>&nbsp; | &nbsp; &nbsp;B_B4&nbsp;</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>wo_02<span class="Apple-tab-span" style="white-space: pre;"> </span>| &nbsp; B<span class="Apple-tab-span" style="white-space: pre;"> </span>&nbsp; | &nbsp; &nbsp;B_B4</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>wo_02<span class="Apple-tab-span" style="white-space: pre;"> </span>| &nbsp; C<span class="Apple-tab-span" style="white-space: pre;"> </span>&nbsp; | &nbsp; &nbsp;C_C4&nbsp;&nbsp;</p> <p><span class="Apple-tab-span" style="white-space: pre;"> </span>------------------------------------------------</p> <p>What i did right now is 'Select Insert' to both table which then i realize that the order_no will be repeated. (I did not set order_no as primary key before realizing this matter)</p>http://www.aspforums.net/Threads/272227/MySQL-check-if-record-exist-then-update-else-insert/http://www.aspforums.net/Threads/272227/MySQL-check-if-record-exist-then-update-else-insert/Sat, 14 Jul 2012 22:30:46 GMTInsert Update Delete into MySql Database in ASP.Net<p>encounter a problem of exception not being handle by user code..</p> <p>&nbsp;any helped is appreciated</p> <pre class="brush: csharp"> &lt;connectionStrings&gt; &lt;add name=&#34;DBConnection&#34; connectionString=&#34;server=localhost;user id=root;password=abc123;database=testing; Allow User Variables=True&#34; providerName=&#34;MySql.Data.MySqlClient&#34; /&gt; &lt;/connectionStrings&gt;</pre> <p>&nbsp;</p> <pre class="brush: csharp">&lt;%@ Page Language=&#34;C#&#34; AutoEventWireup=&#34;true&#34; CodeBehind=&#34;test sekjap.aspx.cs&#34; Inherits=&#34;moe.test_sekjap&#34; %&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head runat=&#34;server&#34;&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;div&gt; &lt;asp:gridview ID=&#34;Gridview1&#34; runat=&#34;server&#34; ShowFooter=&#34;true&#34; AutoGenerateColumns=&#34;false&#34; onrowcreated=&#34;Gridview1_RowCreated&#34;&gt; &lt;Columns&gt; &lt;asp:BoundField DataField=&#34;RowNumber&#34; HeaderText=&#34;Row Number&#34; /&gt; &lt;asp:TemplateField HeaderText=&#34;Test 1&#34;&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID=&#34;TextBox1&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText=&#34;Test 2&#34;&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID=&#34;TextBox2&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText=&#34;Test 3&#34;&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID=&#34;TextBox3&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;FooterStyle HorizontalAlign=&#34;Right&#34; /&gt; &lt;FooterTemplate&gt; &lt;asp:Button ID=&#34;ButtonAdd&#34; runat=&#34;server&#34; Text=&#34;Add New Row&#34; onclick=&#34;ButtonAdd_Click&#34; /&gt; &lt;/FooterTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText=&#34;Header 3&#34;&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID=&#34;Label1&#34; runat=&#34;server&#34; Text=&#34;Click Me&#34;&gt;&lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:gridview&gt; &lt;asp:Button ID=&#34;Button1&#34; runat=&#34;server&#34; Text=&#34;Save&#34; onclick=&#34;Button1_Click&#34; /&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </pre> <p>&nbsp;</p> <pre class="brush: csharp">using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Collections.Specialized; using System.Text; using System.Data.SqlClient; using MySql.Data.MySqlClient; namespace moe { public partial class test_sekjap : System.Web.UI.Page { private void SetInitialRow() { DataTable dt = new DataTable(); DataRow dr = null; dt.Columns.Add(new DataColumn(&#34;RowNumber&#34;, typeof(string))); dt.Columns.Add(new DataColumn(&#34;Column1&#34;, typeof(string))); dt.Columns.Add(new DataColumn(&#34;Column2&#34;, typeof(string))); dt.Columns.Add(new DataColumn(&#34;Column3&#34;, typeof(string))); dr = dt.NewRow(); dr[&#34;RowNumber&#34;] = 1; dr[&#34;Column1&#34;] = string.Empty; dr[&#34;Column2&#34;] = string.Empty; dr[&#34;Column3&#34;] = string.Empty; dt.Rows.Add(dr); //dr = dt.NewRow(); //Store the DataTable in ViewState ViewState[&#34;CurrentTable&#34;] = dt; Gridview1.DataSource = dt; Gridview1.DataBind(); } private void AddNewRowToGrid() { int rowIndex = 0; if (ViewState[&#34;CurrentTable&#34;] != null) { DataTable dtCurrentTable = (DataTable)ViewState[&#34;CurrentTable&#34;]; DataRow drCurrentRow = null; if (dtCurrentTable.Rows.Count &gt; 0) { for (int i = 1; i &lt;= dtCurrentTable.Rows.Count; i++) { //extract the TextBox values TextBox box1 = (TextBox)Gridview1.Rows[rowIndex].Cells[1].FindControl(&#34;TextBox1&#34;); TextBox box2 = (TextBox)Gridview1.Rows[rowIndex].Cells[2].FindControl(&#34;TextBox2&#34;); TextBox box3 = (TextBox)Gridview1.Rows[rowIndex].Cells[3].FindControl(&#34;TextBox3&#34;); drCurrentRow = dtCurrentTable.NewRow(); drCurrentRow[&#34;RowNumber&#34;] = i + 1; drCurrentRow[&#34;Column1&#34;] = box1.Text; drCurrentRow[&#34;Column2&#34;] = box2.Text; drCurrentRow[&#34;Column3&#34;] = box3.Text; rowIndex++; } dtCurrentTable.Rows.Add(drCurrentRow); ViewState[&#34;CurrentTable&#34;] = dtCurrentTable; Gridview1.DataSource = dtCurrentTable; Gridview1.DataBind(); } } else { Response.Write(&#34;ViewState is null&#34;); } //Set Previous Data on Postbacks SetPreviousData(); } private void SetPreviousData() { int rowIndex = 0; if (ViewState[&#34;CurrentTable&#34;] != null) { DataTable dt = (DataTable)ViewState[&#34;CurrentTable&#34;]; if (dt.Rows.Count &gt; 0) { for (int i = 1; i &lt; dt.Rows.Count; i++) { TextBox box1 = (TextBox)Gridview1.Rows[rowIndex].Cells[1].FindControl(&#34;TextBox1&#34;); TextBox box2 = (TextBox)Gridview1.Rows[rowIndex].Cells[2].FindControl(&#34;TextBox2&#34;); TextBox box3 = (TextBox)Gridview1.Rows[rowIndex].Cells[3].FindControl(&#34;TextBox3&#34;); box1.Text = dt.Rows[i][&#34;Column1&#34;].ToString(); box2.Text = dt.Rows[i][&#34;Column2&#34;].ToString(); box3.Text = dt.Rows[i][&#34;Column3&#34;].ToString(); rowIndex++; } } // ViewState[&#34;CurrentTable&#34;] = dt; } } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { SetInitialRow(); } } protected void ButtonAdd_Click(object sender, EventArgs e) { AddNewRowToGrid(); } protected void Button1_Click(object sender, EventArgs e) { int rowIndex = 0; StringCollection sc = new StringCollection(); if (ViewState[&#34;CurrentTable&#34;] != null) { DataTable dtCurrentTable = (DataTable)ViewState[&#34;CurrentTable&#34;]; DataRow drCurrentRow = null; if (dtCurrentTable.Rows.Count &gt; 0) { for (int i = 1; i &lt;= dtCurrentTable.Rows.Count; i++) { //extract the TextBox values TextBox box1 = (TextBox)Gridview1.Rows[rowIndex].Cells[1].FindControl(&#34;TextBox1&#34;); TextBox box2 = (TextBox)Gridview1.Rows[rowIndex].Cells[2].FindControl(&#34;TextBox2&#34;); TextBox box3 = (TextBox)Gridview1.Rows[rowIndex].Cells[3].FindControl(&#34;TextBox3&#34;); //get the values here //Response.Write(box1.Text + &#34;&lt;BR/&gt;&#34;); //Response.Write(box2.Text + &#34;&lt;BR/&gt;&#34;); //Response.Write(box3.Text); sc.Add(box1.Text + &#34;,&#34; + box2.Text + &#34;,&#34; + box3.Text); rowIndex++; } InsertRecords(sc); } } } //A method that returns a string which calls the connection string from the web.config private string GetConnectionString() { //&#34;DBConnection&#34; is the name of the Connection String //that was set up from the web.config file return System.Configuration.ConfigurationManager.ConnectionStrings[&#34;DBConnection&#34;].ConnectionString; } //A method that Inserts the records to the database private void InsertRecords(StringCollection sc) { MySqlConnection conn = new MySqlConnection(GetConnectionString()); StringBuilder sb = new StringBuilder(string.Empty); string[] splitItems = null; foreach (string item in sc) { const string sqlStatement = &#34;INSERT INTO SampleTable (Column1,Column2,Column3) VALUES&#34;; if (item.Contains(&#34;,&#34;)) { splitItems = item.Split(&#34;,&#34;.ToCharArray()); sb.AppendFormat(&#34;{0}(&#39;{1}&#39;,&#39;{2}&#39;,&#39;{3}&#39;); &#34;, sqlStatement, splitItems[0], splitItems[1], splitItems[2]); } } try { conn.Open(); MySqlCommand cmd = new MySqlCommand(sb.ToString(), conn); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); Page.ClientScript.RegisterClientScriptBlock(typeof(Page), &#34;Script&#34;, &#34;alert(&#39;Records Successfuly Saved!&#39;);&#34;, true); } catch (System.Data.SqlClient.SqlException ex) { string msg = &#34;Insert Error:&#34;; msg += ex.Message; throw new Exception(msg); } finally { conn.Close(); } } protected void Gridview1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label l = (Label)e.Row.FindControl(&#34;Label1&#34;); if (l != null) { string script = &#34;window.open(&#39;Default.aspx&#39;);&#34;; l.Attributes.Add(&#34;onclick&#34;, script); } } } } }</pre> <p>&nbsp;</p> <p>this is my database table</p> <pre class="brush: csharp">CREATE TABLE `sampletable` ( `ID` tinyint(4) NOT NULL, `Column1` varchar(50) DEFAULT NULL, `Column2` varchar(50) DEFAULT NULL, `Column3` varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8</pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/124842/Insert-Update-Delete-into-MySql-Database-in-ASPNet/http://www.aspforums.net/Threads/124842/Insert-Update-Delete-into-MySql-Database-in-ASPNet/Fri, 24 Jun 2016 09:01:15 GMTInsert Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil and Telugu languages Text characters in MySQL using C# and VB.Net<p>How to save hindi text in myql and retrive in Gridview?</p>http://www.aspforums.net/Threads/174459/Insert-Hindi-Marathi-Gujarati-Urdu-Persian-Arabic-Tamil-and-Telugu-languages-Text-characters-in-MySQL-using-C-and-VBNet/http://www.aspforums.net/Threads/174459/Insert-Hindi-Marathi-Gujarati-Urdu-Persian-Arabic-Tamil-and-Telugu-languages-Text-characters-in-MySQL-using-C-and-VBNet/Tue, 13 Jan 2015 04:00:39 GMTImplement Paging in DataList with MySql Database in ASP.Net<p>I want datalist pagination without stored procedure.</p> <p>i am currently using mysql database with asp.net.</p> <p>please help me out.</p>http://www.aspforums.net/Threads/942910/Implement-Paging-in-DataList-with-MySql-Database-in-ASPNet/http://www.aspforums.net/Threads/942910/Implement-Paging-in-DataList-with-MySql-Database-in-ASPNet/Sun, 23 Aug 2015 03:21:43 GMTHow to write nested CASE statements in MySQL Query with Example<p>how to write stored procedure</p> <p>in the situation if <strong>business</strong> table have column like&nbsp; empid int, custtype varchar,dealertype varchar,photographertype varchar, sal int,</p> <p>employee belong either custtype or dealertype or photographertype</p> <p>i want show the result as if</p> <table border="1" cellspacing="0" cellpadding="0"> <tbody> <tr> <td valign="top" width="133"> <p>empid</p> </td> <td valign="top" width="133"> <p>custtype</p> </td> <td valign="top" width="133"> <p>dealertype</p> </td> <td valign="top" width="154"> <p>photographertype</p> </td> <td valign="top" width="133"> <p>sal</p> </td> </tr> <tr> <td valign="top" width="133"> <p>&nbsp;1</p> </td> <td valign="top" width="133"> <p>&nbsp;</p> </td> <td valign="top" width="133"> <p>&nbsp;d</p> </td> <td valign="top" width="154"> <p>&nbsp;</p> </td> <td valign="top" width="133"> <p>&nbsp;1000</p> </td> </tr> <tr> <td valign="top" width="133"> <p>&nbsp;2</p> </td> <td valign="top" width="133"> <p>&nbsp;c</p> </td> <td valign="top" width="133"> <p>&nbsp;</p> </td> <td valign="top" width="154"> <p>&nbsp;</p> </td> <td valign="top" width="133"> <p>&nbsp;2000</p> </td> </tr> </tbody> </table> <p>if i fetch the data from <strong>business</strong>&nbsp; table my out put should as</p> <table width="245" border="1" cellspacing="0" cellpadding="0"> <tbody> <tr> <td valign="top" width="133"> <p>empid</p> </td> <td valign="top" width="159"> <p>emptypw</p> </td> </tr> <tr> <td valign="top" width="133"> <p>1</p> </td> <td valign="top" width="159"> <p>d</p> </td> </tr> <tr> <td valign="top" width="133"> <p>&nbsp;</p> </td> <td valign="top" width="159"> <p>&nbsp;</p> </td> </tr> </tbody> </table> <p>&nbsp;</p>http://www.aspforums.net/Threads/377580/How-to-write-nested-CASE-statements-in-MySQL-Query-with-Example/http://www.aspforums.net/Threads/377580/How-to-write-nested-CASE-statements-in-MySQL-Query-with-Example/Sun, 29 Sep 2013 07:13:01 GMTHow to use XML in MySQL Stored Procedure<p>i am trying to convert the stored procedure in SQL in MYSQL without using any tool.</p> <p>In sql there is a stored procedure which use xml document handle.here is below code in sql using exec sp_xml_preparedocument.</p> <p>create procedure insert(xmlstring varchar(max))</p> <p>BEGIN<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;DECLARE @xmlHandle INT <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; DECLARE @DemoTable TABLE <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; ( <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [Name]&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;VARCHAR(50), <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [Address]&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;VARCHAR(50), <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [Phone]&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;VARCHAR(50)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; ) <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; EXEC sp_xml_preparedocument @xmlHandle output, @xmlString&nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;INSERT INTO @DemoTable <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SELECT&nbsp; [Name]&nbsp;&nbsp; &nbsp;,<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;[Address],<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;[Phone]&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;FROM&nbsp; OPENXML (@xmlHandle, '/NewDataSet/SampleDataTable',1) <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;WITH ([Name]&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;varchar(50)&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'@Name', <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [Address]&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;varchar(50)&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'@Address', <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [Phone]&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;varchar(50)&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'@Phone'<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; )<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;INSERT INTO Details ([Name], <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;[Address], <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;[Phone]) <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;(SELECT [Name] ,<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [Address],<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [Phone]<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;FROM @DemoTable)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;EXEC sp_xml_removedocument @xmlHandle</p> <p>&nbsp;</p> <p>I want to convert this sql stored procedure into mysql,but the problem is that mysql doesnt support sp_xml_preparedocument and sp_xml_removedocument</p>http://www.aspforums.net/Threads/209360/How-to-use-XML-in-MySQL-Stored-Procedure/http://www.aspforums.net/Threads/209360/How-to-use-XML-in-MySQL-Stored-Procedure/Mon, 28 Oct 2013 10:00:56 GMTHow to use TOP keyword in MySQL Query<p>We can &nbsp;write select TOP 8 from Table in SQL Server .How can &nbsp;i use top keyword in mysql join</p>http://www.aspforums.net/Threads/397132/How-to-use-TOP-keyword-in-MySQL-Query/http://www.aspforums.net/Threads/397132/How-to-use-TOP-keyword-in-MySQL-Query/Sat, 19 Jul 2014 03:08:11 GMT