Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 2nd, 2004, 11:05 AM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default MS OLE DB Provider for ODBC -not working 4 me

re: .net, dotnet connect via System.Data.OleDb MSDASQL.1 (MAXDB/SAPDB - published by MYSQL)

I have the vb.net Visual Studio STANDARD edition and cannot use "Server Explorer" with Microsoft OLE DB Provider for ODBC Drivers - it is restriced to MSDE and Access and MS SQL. I am hoping this only is disabled in VS Studio. I am assuming with the right connection string I can successfully connect in code. Can anyone confirm if this is true?

' My connection string below
"Provider=MSDASQL.1;Persist Security Info=False;User ID=CM;Extended Properties='DSN=Contact;UID=CM;pwd=mypass;SERVERDB =CONTACT;SERVERNODE=192.168.32.##;'"

The error message is as follows: The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not support the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc).

I know ODBC works and the ADODB Interop assembly in .net works ok (but I am having problems with datagrid update event. I was just hoping to be able to take advantage of the new .net syntax like datasets etc...

I would love to hear from anyone who successfully develops using .net with MAXDB/SAPDB via the Microsoft OLE DB Provider for ODBC Drivers.

Thanks in Advance
Reply With Quote
  #2 (permalink)  
Old August 2nd, 2004, 12:06 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

I can't get what you mean.Is there any relation between your provider and dataset object?I don't think.
>>I am having problems with datagrid update event...
can you tell us exactly what problem you have...
when you have to use ODBC provider why you insist on using OLE DB
(I told you there is a provider for MYSQL ,have you checked it?)


--------------------------------------------
Mehdi.
Reply With Quote
  #3 (permalink)  
Old August 2nd, 2004, 12:29 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Here you have two problems
1-what is your suitable Data Provider?....that it seems ODBC
2-a problem in your datagrid event and your dataset....
There is not any connection between these two problems.

--------------------------------------------
Mehdi.
Reply With Quote
  #4 (permalink)  
Old August 2nd, 2004, 12:59 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default


Mehdi - thanks for your response and sorry for the confusion. I will attempt to clarify and explain my insistance on trying to use the "Microsoft OLE DB Provider for ODBC Drivers".

1. I am not using MYSQL database. I am using a database called MAXDB which is a completely different product to MYSQL. Its a higher end product currently supported and sold by MYSQL ( more info on this db can be found at www.mysql.com). An OLEDB provider for MAXDB does not exist.

2. I can use the namespace Microsoft.Data.Odbc and this works OK but I don't like the interface. There doesn't seem to be a way to reference database values by fieldname. Correct me if I am wrong but I can't seem to do the asp equivelent of recordset.fields("cust_name") using this .net interface.

3. I can also use the ADODB interop assembly. This appears to work very nicely and is the exact same syntax as I am used to in old ASP. There is even a way to fill a datastore using a recordset. But when I fill a datastore from the ADODB recordset and than assign the datastore to a datagrid the .Text property of my TextBox control in the datagrid.OnUpdateCommand handler returns only the PREVIOUS value and NOT my changed value. I have implemented the Textbox within the <EditItemTemplate> tags between the <columns> tags.This is driving me crazy - I know I am getting a handle to the textbox because I can successfully modify other properties for example .Visible (I will post a separate thread for this problem and include code).

4. Because of problems 2 and 3 I am attempting to use "Microsoft OLE DB Provider for ODBC Drivers" and the following namespace: Imports System.Data.OleDb. If I can get this to work it has in my understanding the following advantages....

a. It is native .net functionality (I think) correct me if I am mistaken.

b. It will probably work with my datastore and datagrid, the adodb recordset I cannot get to work (see point 3) above.

I have only been programming in .net since Saturday morning, today is Monday. Please exscuse my lack of clarity - hopefully over time I can learn to write clear and precise questions.

Thanks again and if you can help I would sincerly appreciate it.
Reply With Quote
  #5 (permalink)  
Old August 2nd, 2004, 04:21 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Dear humour,
I can't get the meaning of this sentence "Microsoft OLE DB Provider for ODBC Drivers"
Did you know .NET has also an ODBC provider this differs to OLE DB data provider
you can use ODBC provider through System.Data.Odbc namespace just like System.Data.OleDb namespace
but about your second problem...
you can do it exactly with ODBC provider you should now System.Data.Odbc.OdbcDataReader just do the same work recordsets did
(OdbcDataReader,SqlDataReader,OledbDataReader objects are equivalent to recordsets)
recordset.fields("cust_name")(ASP) == yourOdbcDataReader["cust_name"](ASP.NET C#)


--------------------------------------------
Mehdi.
Reply With Quote
  #6 (permalink)  
Old August 2nd, 2004, 05:52 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default


Just tried MyODBCReader("field_name")

Works like a charm.

I knew about and started playing with the Microsoft.Data.ODBC namespace that syntax just alluded me. I thought one had retrieve fields from the reader object via the GetString, GetDate methods etc....

Thanks again for your help.
Reply With Quote
  #7 (permalink)  
Old August 3rd, 2004, 03:19 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

One may use the GetXXXXX methods of the datareaders but, as you have found, must use the field ordinals. This has its advantages.
A)Using ordinals is much faster than fieldnames
B)Using GetXXX obviously relieves you of having to do the type cast (which may also be faster).

All .NET data classes let you access the fields by name in some way or another.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft OLE DB Provider for ODBC Drivers phantom3008 Classic ASP Basics 6 March 15th, 2007 09:39 AM
MS OLE DB Provider For "Sql Server"/"ODBC Drivers" ZArrinPour SQL Server 2000 1 April 20th, 2006 09:30 AM
Micr OLE DB Provider for ODBC Drivers (0x80040E14) treasacrowe Classic ASP Databases 4 July 13th, 2004 09:09 AM
Microsoft OLE DB Provider for ODBC Drivers surendran Classic ASP Databases 4 October 27th, 2003 10:23 AM
OLE DB Provider for ODBC Drivers error '80004005' Routhg Access ASP 2 June 11th, 2003 07:02 AM



All times are GMT -4. The time now is 07:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.