MySqlDataSource SelectParameter

MySqlDataSource SelectParameter

Postby dooh » Thu 25 Dec 2008 18:45

Hi,

How can i conver and Parameter to a ControlParameter, i mean tha value it will be set from a control.

Now i can do that but with: ObjectDataSource.

It is possible with MySqlDataSource?

Thanks
dooh
 
Posts: 30
Joined: Sun 14 Jan 2007 21:11

Postby Shalex » Fri 26 Dec 2008 12:13

Yes, this functionality is available in dotConnect for MySQL.
You can find the example of using the SqlDataSource component with ControlParameter here: http://msdn.microsoft.com/en-us/library ... meter.aspx . The usage of MySqlDataSource is similar. The only difference is the necessity of adding the following line in your *.aspx file to register our assembly:
Code: Select all
<%@ Register Assembly="Devart.Data.MySql.Web" Namespace="Devart.Data.MySql.Web" TagPrefix="cc1" %>

In this case you can use MySqlDataSource in the following way:
Code: Select all
              id="MySqlDataSource1"
        runat="server"
        connectionstring="<%$ ConnectionStrings:conn%>"
        selectcommand="SELECT * from dept WHERE deptno = :Title">
       
           
       

     

Fore more samples, please go to Start Menu | All Programs | Devart dotConnect for MySQL | Samples | Web. As an alternative, you can find our samples in the installation folder of our product.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44

Postby dooh » Fri 26 Dec 2008 16:40

Ok Alex,

But these steps we have to completly manually.

Is possible to do that in design time?
dooh
 
Posts: 30
Joined: Sun 14 Jan 2007 21:11

Postby Shalex » Sat 27 Dec 2008 10:00

Registering our assembly occurs automatically when you drag and drop MySQLDataSource from Toolbox in design time. But you need to make settings with ControlParameter manually as you work with Microsoft's SQLDataSource.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL