Puiu Posted November 12, 2005 Posted November 12, 2005 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 ? Quote
kejpa Posted November 14, 2005 Posted November 14, 2005 I don't think you should be using a SQLDataSource with MySQL, you probably need a OdbcDataSource and the MySQL odbc-driver... HTH /Kejpa Quote
penfold69 Posted November 14, 2005 Posted November 14, 2005 Preferably, use the MySQL Connector/Net, which will provide you with: MySqlConnection, MySqlCommand, MySqlDataAdapter MySqlDataReader MySqlParameter then retest - it should work fine! Quote
Puiu Posted November 15, 2005 Author Posted November 15, 2005 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.