[Mono-bugs] [Bug 48642][Maj] New - problem inserting data

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 19 Sep 2003 13:43:08 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by suresh7366@sancharnet.in.

http://bugzilla.ximian.com/show_bug.cgi?id=48642

--- shadow/48642	2003-09-19 13:43:08.000000000 -0400
+++ shadow/48642.tmp.5499	2003-09-19 13:43:08.000000000 -0400
@@ -0,0 +1,128 @@
+Bug#: 48642
+Product: Mono/Runtime
+Version: unspecified
+OS: other
+OS Details: rh 8 (pcq linux distro)
+Status: NEW   
+Resolution: 
+Severity: 016 Two days
+Priority: Major
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: suresh7366@sancharnet.in               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: problem inserting data
+
+Dear Sir,
+As i mentioned abt the asp.net application. there is a small problem.
+Description of the code:
+1. aspx code which will accept and insert data into mysql database
+2. code to display data from the database
+3. a script to create the database (not related to the current problem)
+
+OS: Redhat linux 8.0
+
+
+problem:
+1. i am able use mozilla and run the asp code with both apache and xsp
+server
+2. But i find the code executes faster and inserts data quickly with the 
+xsp
+server than apache.
+3. But the same code has problems when run with lynx (text based browser)
+    Here i am able to insert code when apache server is used
+    But with xsp, though page is served and displayed, data is entered, the
+    data is not inserted in the database
+
+I NEED TO USE LYNX and wish the data entry to be fast. Please guide me in
+this issue.
+I am attaching the code for your perusal.
+
+Suresh
+
+
+CODE LISTING:
+
+script to create table in mysql:
+	use pcquest;
+	create table designations (name varchar(50),designation varchar
+(20));
+
+<%@ Import Namespace="ByteFX.Data.MySQLClient" %>
+
+<html>
+<body>
+
+
+
+
+asp code to insert data into the table:
+
+	<script runat="server">
+
+	void insert(Object obj, EventArgs e)
+		{
+		MySQLConnection conn = new MySQLConnection
+("Server=localhost;Database=pcquest;User ID=root;Password=;");
+		MySQLCommand cmd = new MySQLCommand("insert into 
+designations values ('"+name.Text+"','"+designation.Text+"')",conn);
+		cmd.Connection.Open();
+		cmd.ExecuteNonQuery();
+		cmd.Connection.Close();
+		Response.Write("<b>Data Inserted into the database</b>");
+		name.Text="";
+		designation.Text="";	
+		}
+	</script>
+
+
+	<form action="insert.aspx" runat="server">
+	<br> Name:
+	<asp:textbox id="name" MaxLength="50" runat="server" /> 
+
+	<br> Designation
+	<asp:textbox id="designation" MaxLength="20" runat="server" /> 
+
+	<asp:button type="submit" text="Insert into database" 
+OnClick="insert" runat="server"  />
+
+	</form>
+
+	</body>
+	</html>
+
+asp code to display the data
+
+	<%@ Import Namespace="System.Data" %>
+	<%@ Import Namespace="ByteFX.Data.MySQLClient" %>
+
+	<html>
+	<body>
+
+
+	<script runat="server">
+
+	void Page_Load(Object obj, EventArgs e)
+		{
+		MySQLConnection conn = new MySQLConnection
+("Server=localhost;Database=pcquest;User ID=root;Password=;");
+		MySQLDataAdapter adapter = new MySQLDataAdapter("select * 
+from designations",conn);
+
+		DataSet dataset = new DataSet();
+		adapter.Fill(dataset,"designations");
+
+		grid.DataSource=dataset.Tables["designations"].DefaultView;
+		grid.DataBind();
+
+		}
+	</script>
+
+
+	<asp:DataGrid id="grid" runat="server" />
+
+	</body>
+	</html>