Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a stored procedure on MySQL Server that goes something like:

 

Select * from phones where idphone=param1;

 

 

in vb 2005 the code is:

 

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
       dim strLink as string ="3"
       sds.SelectCommand = "SrcModel" 'sds is a SQLDataSource
       sds.SelectCommandType = SqlDataSourceCommandType.StoredProcedure


       Dim param1 As New FormParameter("param1", TypeCode.String, strLink)
       param1.Direction = Data.ParameterDirection.Input

       sds.SelectParameters.Add(param1)
       
       GridView1.DataSource = sds
       GridView1.DataBind()
   End Sub

 

the connection string for the SQLDataSource is a dsn that works fine

The problem is that the gridview doesn't show anything... there is no error either..

 

I don't get it, in vb 2003 you had something like: cmdSelect.ExecuteNonQuery

What is the equivalent in VB 2005 ?

Posted

Preferably, use the MySQL Connector/Net, which will provide you with:

 

MySqlConnection,

MySqlCommand,

MySqlDataAdapter

MySqlDataReader

MySqlParameter

 

then retest - it should work fine!

Posted

In the end i used Mysql Connector for .Net and it worked just like in VS 2003.

 

Using the SQLDatasource (with an ODBC connection) i was able to connect to the mysql database, but i could not use the stored procedures like i was able with a MSSQL database.

 

Thank you people

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...