.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

ADO fast, ODBC not so much with mysql odbc 5.1

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
Hello-   I have been trying to convert our internal webpage from asp to ASP.NET with .NET 4.0. Some of our pages pull from multiple tables/databases to comprise a single page. The original asp pages connecting to the database are LIGHTNING fast, However the new pages using the MySQL ODBC 5.1 drivers fail to come even close to the asp pages. Average load time for an ASP.NET is about 92000ms., ASP load time about 8ms. Here is what I've tried/noticed 1. Regardless of setting ViewState,Debug to (true/false) in page or web.config makes no difference, load time stays about 6000ms per call to database 2. We have two Servers (web and main), ASP pages take about the same time (8ms) to load from each/both servers, ASP.NET pages take about 8ms(main) from one and about 12000ms(web) from the other 3. I tried to trace the ODBC driver, but to no avail (don't have admin access to force). Using the TEST button through the dialog box has about 5sec delay from (web) and instant feedback from (main) 4. Checked all the code calls to make sure that for every open there is a close, same slow result from ODBC 5. Tried to have only one open and one close call to the DB and many reads in between, same result: slow performance. 6. I have read the article about optimizing my code through the use of caching etc... I don't believe this applies to my s

View Complete Post

More Related Resource Links

passing parameter using ODBC - mysql

Dear All, I'm having problem on passing parameter on odbc because it's not working at all.  I tried this using sql and I have no problem at all. All are working fine.  Is there a different syntax on odbc?  Here's my code: Private Sub BindDetails() ' Obtain the index of the selected row Dim selectedRowIndex As Integer = GridEmployee.SelectedIndex ' Read the employee ID Dim IDNumber As Integer = GridEmployee.DataKeys(selectedRowIndex).Value ' Define data objects Dim conn As OdbcConnection Dim comm As OdbcCommand Dim reader As OdbcDataReader Dim connectionString As String = _ ConfigurationManager.ConnectionStrings( _ "mysqlconn").ConnectionString ' Initialize connection conn = New OdbcConnection(connectionString) ' Create command comm = New OdbcCommand("SELECT employee.IDNumber, employee.EmployeeID, project.ProjectName, team.TeamName, employee.Username, employee.`Password`, employee.LastName, employee.FirstName, employee.MiddleName, employee.NickName, employee.EmailAddress, employee.DateHired, employee.LengthService, employee.RegularizationDate, employeestatus.EmployeeStatusName, employee.Birthdate, employee.Mobile1, employee.Mobile2, employee.Phone1, employee.Address, employee.Colleg

Read image from MySQL with ODBC


Hello everyone. I have a problem that I can't figure out. I shall read an images from a column in a MySQL database. I use a simple aspx page and the codebehind file with the code below.

It is ok to read the image if I don't use any parameter value in the where clause, but if I use it, nothing is returned. I don't know if I have done anything wrong in the code. I have also tried to set a proper value on the parameter.value without success. So my conclusion is that the parameter sertup is wrong in my code. Any ideas someone?


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim PictureID As Integer = Convert.ToInt32(Request.QueryString("id"))

        'Connect to the database and bring back the image contents & MIME type for the specified picture

        Using myConnection As New OdbcConnection("Driver={MySQL ODBC 5.1 Driver};server=localhost;uid=;pwd={};database=xxx;port=3306")


            Const SQL As String = "SELECT blobdata FROM tblblogg WHERE id = @PictureID"  ---> If I change this parameter to a existing id it works


How to fix "ERROR [08S01] [MySQL][ODBC 5.1 Driver][mysqld-5.1.46-community]MySQL server has gone awa


Hi Experts ,

I have hosted my web application into server . I got below error on and off but when i refresh the page , the error disappear . Im unable to figure out what is the problem because the error is normal happen after using the application about 10 to 20 mins . But when i run in localhost , there is no problem at all .  

I read lot of articles and testing on it but still failed .  Pls help . Im using asp.net C# and mysql .

Million Thanks ..




ERROR [08S01] [MySQL][ODBC 5.1 Driver][mysqld-5.1.46-community]MySQL server has gone away

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.Odbc.OdbcException: ERROR [08S01] [MySQL][ODBC 5.1 Driver][mysqld-5.1.46-community]MySQL server has gone away

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and lo

Connecting BCS to ODBC / MySQL sources in SharePoint Designer 2010


Internally we are trying to migrate our MOSS 2007 solution to SP2010 in readiness for RTM.  So far, minus a few tweaks everything has been successful.

However we have a requirement to connect to a MySQL database.  It would be great to do this within SPD 2010 rather than via Visual Studio (which I suspect is the only way).

Does any body have any ideas or suggestions regarding this?

Accessing MySQL Data using ODBC w/ BDC Definition Editor


Hello everyone.

Background: I'm a computer science student doing some work for a non-for-profit, and have minimal experience with SP 2007, ODBC, etc.

Overview: I'm trying to create a BDC definition file using the definition editor (found in the SDK), rather than editing a template XML manually. I found this thread to be fairly helpful in getting me started on what seems to be the right path: http://social.msdn.microsoft.com/Forums/en/sharepointbdc/thread/833a9583-5f4c-4ed9-b9c8-f5834b790375

In order to establish a connection to the remotely hosted MySQL database I must provide an ODBC source for the client user/system, correct?

 My questions are: 

  • How does using ODBC affect things once I upload the ADF to the Shared Services Provider (SSP)? Do I now need to provide a duplicate ODBC Source on the server hosting sharepoint for the BDC to connect to the database? Apologies if I am not understanding this correctly.
  • If the above process is correct, how might I expect this process to change for sharepoint 2010? The organization is looking to roll-out SP2010

ERROR [S1000] [Microsoft][ODBC Visual FoxPro Driver]Function name is missing ).


I Am Continiously Getting Error For Following Line Of Code, It Work  Fine In Other Database

Am I Doing Any Mistake

if (sh3itno != "" && dpsh3no != "")
                string queryy = "SELECT [CHEQNO] FROM [SH3MAST] WHERE (([CHEQDATE] = " + chqdate + ") AND ([FAVOUR] = " + favour + ") AND ([CHQTYPE] = " + ctype + ") AND ([TRSTN] = " + trstn + ") AND ([TRBANK] = " + trbank + ") AND ([SH3ITNO] = " + sh3itno + ") AND ([DPSH3NO] = " + dpsh3no + "))";
                OdbcCommand cmd3 = new OdbcCommand(queryy, connen1);
                string chqno =cmd3.ExecuteScalar().ToString(); (Here Iam Getting Error)
                tbl.Rows[i]["cheque no"] = chqno;
Stack Trace: 

[OdbcException (0x80131937): ERROR [S1000] [Microsoft][ODBC Visual FoxPro Driver]Function name is missing ).]
   System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) +39
   System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, Strin

Basic ODBC Connection to connect to Crystal ???


I have visual studio 2008 professional with the inbuilt crystal reports version 10 I think.  I create everything from my laptop and IIS runs from my laptop as well.

I have created the most basic report to try and figure out a problem I have, anyways the report contains one database field that is it .... which I connect to by ODBC.  I then create a web form add the crystal report viewer to the report and the crystal report source run the web page and it loads the data from the field as I would expect to the crystal report viewer !!

I have several ODBC connections setup on my machine one using integrated security the other using SQL authentication both are system DSNs.  Now when I publish my application and access it from IIS and not the localhost I can access everything from my application ok except when I go to form that has the crystal reports I get this error (ODBC used here is the 'sa' account)

Logon failed. Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Error in File

If I use the other ODBC that uses Windows authentication I get this error message

Logon failed. Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database  requested by the login. T

persist security info not available by a codebase odbc driver



I want to interface the software Sage ventpartner with sharepoint.

For that i have to use the odbc {codebaseStand} driver and i know that the following string is working :


The pb is when i construct my bdc xml file i have to enter :

        <Property Name="rdbconnectionDriver" Type="System.String">{CodeBaseOdbcStand}</Property>
        <Property Name="rdbconnectiondbq" Type="System.String">c:\ventpart\database</Property>
        <Property Name="rdbconnectionuid" Type="System.String">administrateur</Property>
        <Property Name="rdbconnection Trusted_Connection " Type="System.String">yes</Property>
        <Property Name="DatabaseAccessProvider" Type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAccessProvider">Odbc</Property>
        <Property Name="SsoApplicationId" Type="System.String">23</Property>

SQL Server doesn't exist or access denied while connecting with Access 2010 ODBC

Hello all. I am using Access 2010 and SQL Server 2008 (locally). I can easily connect to server using SSMS and it works excellent. But when I want to import a table to Access 2010 using ODBC, it says that "SQL Server doesn't exist or access denied". It worked previously - almost 3 days ago, but now, it doesn't! Please help! Thanks Mohammad Javahery

Can't Create ODBC to Local SQL Server Express 2008

Hello. I have SQL Server Express 2008 SP1 LOCALLY on my Windows XP Professional SP3 box. I have databases already created in Access 2007 that I imported into SQL. Now I want to keep the front end Access forms for data entry but have them connect to the databases in SQL. What I can't seem to do is connect from Access to the SQL db's because I can't create the ODBC connection. When I try to connect, I get the following two 'Connection failed' errors: 1. SQLState: '08001' SQL Server Error: 10061 [Microsoft][SQL Server Native Client 10.0]TCP Provider: No connection could be made because the target machine actively refused it. 2. SQLState: 'HYT00' SQL Server Error: 0 [Microsoft][SQL Server Native Client 10.0]Login timeout expired Additionally, this information may help. 1. Windows firewall is turned off. 2. In SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for SQLEXPRESS, Shared Memory, Named Pipes and TCP/IP are all 'Enabled'. The order is Shared Memory (1), Named Pipes (2) and TCP/IP (3). 3. In SQL Server Configuration Manager > SQL Native Client 10.0 Configuration > Client Protocols, the above three are also 'Enabled'. The order is Shared Memory (1), Named Pipes (2) and TCP/IP (3). Double-clicking TCP/IP tells me that the default port is 1433. 4. Running "netstat -ano", I see no entries for [myIPaddress]:1433.

Connectivity Issue through ODBC

Here's the scenario: On the server: (Windows 2003, sql server 2005 sp 3) 1. named server is running on port 1433 2. all protocols except VIA is enabled 3. Remote Connections is enabled for both tcp and named pipes on surface area configuration 4. SQL Browser is running 5. Windows Firewall is disabled 6. Network firewall has allowed TCP traffic to port 1433, one way. 7. can ping the client 8. Local Securty Policy to access this computer from the network is permitted to everyone 9. SQL User and windows user can login to the server 10. No login failed connections on the error logs On the client: (WIndows XP sp2) 1. server can be ping 2. telnet server 1433 is successful 3. NSlookup can resolve server name 4. System DSN and USer DSN using SQL Server driver works to other servers Creating a DSN to the server results to Connection Failed:  SQL State 01000' SQL Server Error: 53 [Microsoft][ODBC SQL DRIVER] [DBNETLIB] CONNECTION.OPEN(CONNECT()). CONNECTION FAILED SQL STATE '08001' SQL SERVER ERROR 17 [Microsoft][ODBC SQL DRIVER] [DBNETLIB]Server Does not Exists or access is denied. What am I Missing here?

ODBC Driver for SQL Server Compact Edition

I know that there is no ODBC driver available for SQL Server Compact Edition version 3.5.  Do you plan to add an ODBC driver in future release? If yes, is it high in your priority list?   The scenario why I am looking for an ODBC driver is to connect an MS Access application to a SDF file instead of MDB file.  This will enable me to easily sync the SDF file with SQL server repository using the new Data Sync Services.   Mario Cardinal MVP Solutions Architect

ODBC call failed

I try to export a table from Access 2007 to SQL-Server Express 2008R2 and it returns the error: ODBC call failed. [Microsoft][SQL Server Native Client 1.0][SQL Sever] Line1: Specifed Scale 1 is invalid (#1002). The problem is related with a datetime column, because if I drop this column it is possible to export. Thanks for your help.    

SQL Server 2008, ASP Classic, IIS and ODBC.

Hi.   I'm using Windows XP SP3 SQL Server 2008 Login:sa Password:12345 http://img2.pict.com/9d/b2/65/3153366/0/sql.jpg   ODBC - Am I doing it correctly? http://img2.pict.com/ee/6b/8b/3153363/0/800/odbc.jpg   Loading the 'Main.asp' file and got this error;   http://img2.pict.com/cd/8e/ad/3153435/0/800/ptb.jpg   Line 106 refers to the underline text below; (cn.Open "DSN=Trains;UID=sa;PWD=;DATABASE=Trains") &lt;%@ Language=VBScript %&gt; &lt;% Response.Buffer = True Response.Expires = -1000 %&gt; &lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Main Page&lt;/TITLE&gt; &lt;base target="_self"&gt; &lt;BODY bgProperties=fixed bgColor=#FFFFFF leftMargin=0 topMargin=0 bottommargin10&gt; &lt;DIV style="LEFT: 5px; POSITION: absolute; TOP: 80px"&gt;&lt;/DIV&gt; &lt;style type="text/css"&gt; body           {font-size: 8pt; font-family: verdana; color:white;} table, tr, td  {font-size: 10pt; font-family: verdana; color: black;} a:link         {font-size: 8pt; font-family: verdana; color:black; text-decoration: none;} a:visited      {font-size: 8pt; font-family: verdana; color:black; text-decoration: none;} a:

OMPM script cannot find ODBC Driver

I'm setting up a local OMPM (Office Migration Planning Manager) application, which requires an SQL Server database. I installed SQL Server Express successfully. When I run the OMPM script to create the database (CreateDB.bat) I get the following error: SQL-DMO Install Required: This operation requires the SQL Server ODBC Driver, version 3.80 or later, which comes with SQL Server 2000, SQL Server 2005 and SQL Server Express. I installed SQL Server Express with this file "SQLEXPR32_x86_ENU.exe" Could it be that the ODBC Driver was not registered correctly during the install of SQL Server Express? Alternatively, where can I find the missing driver? Thanks in advance, Maurice

odbc connection failed

i have microsoft sql server 2000. i am using program based on VB.when i try to run the components like  import database design, link table, etc then the message get displayed " ODBC connection failed".please give me the solution.please.....

[OLE/DB provider returned message: [MERANT][ODBC Sybase driver]Distributed transaction enlistment fa

Ok, i have seen tons of articles on the error, but still can't figure it out. This is being executed through nested procedure calls, until it is roughly 3 levels deep, then makes a call to Sybase using dynamic SQL and OPENROWSET. The message that is returned is listed below. Yes, i looked up all I could find on it. The thing I find interesting is I can simply take the dynamic SQL and the openrowset call out and run it in query analyzer just fine. but when I run it through the procedure it generates the errors. Any thoughts?   [OLE/DB provider returned message: [MERANT][ODBC Sybase driver]Distributed transaction enlistment failed.] Server: Msg 7391, Level 16, State 1, Line 1 The operation could not be performed because the OLE DB provider 'MSDASQL' was unable to begin a distributed transaction. [OLE/DB provider returned message: [MERANT][ODBC Sybase driver]Load of XA library failed.] OLE DB error trace [OLE/DB Provider 'MSDASQL' ITransactionJoin::JoinTransaction returned 0x8004d00a]. John M. Couch Insight Enterprises Inc. 6820 S. Harl Ave, Tempe, Az 85283 Email: john.couch@insight.com
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend