ASP.NET / MySQL

Newbie FAQ and/or Problems.

 

Set EnableEventValidation="false"

If you are using the DataPager you need to put your data binding after Page_Load event, otherwise your first postback fails. Just put binding in PreRender or Render and it will solve the issue. This article doesn't demonstrate this issue, and you can spend hours trying understand why it doesn't work.

Default.aspx.vb

If there is a way to do this, I'm not aware of how. To have multiple queries, it needs to be done in the code behind and bound to a DataReader, DataSet, ListView, Label, etc.

Example: Here is an example of two MySQL queries on one connection. The first is an executescalar that sums a bit in a table and sets a string to the value. The second is a query bound to a DataReader. The string created in the first query is used as a dynamic LIMIT statement on the second query:

 Default.aspx.vb

Example: Here is an example of a LIMIT statement created by a variable set in another query. The first query is an executescalar that sums a bit in a table and sets a string to the value. The second is a query bound to a DataReader. The string created in the first query is used as a dynamic LIMIT statement on the second query:

 Default.aspx.vb

Yes. 

           

  

 

 

Tags:  asp.net 3.5, Visual Basic, VB, MySQL 5.1, MySQL .net connector