473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cannot find OleDbConnection

375 256MB
Hello
I am migrating from vb.net to C#.net

I am supposed to drag and drop a Oledbconnection.

I Cannot find it. I searched in the tool bar thoroughly.

Where's it located?

Thanks
Jul 20 '07 #1
5 1923
kenobewan
4,871 Expert 4TB
I believe that's because its not there. There are not as many objects supplied to C# programmers in VS. So that's is why they believe that they are smarter then we are ;).
Jul 20 '07 #2
RoninZA
78
Hi cmrhema,

C# developers ARE smarter than VB developers! ;)

You'll have to use the OleDbConnection in code, instead of dragging it onto the form. You can find it in the System.Data.OleDbClient namespace.

Use as follows:
Expand|Select|Wrap|Line Numbers
  1. System.Data.OleDbClient.OleDbConnection cn = new System.Data.OleDbClient.OleDbConnection(connectionString);
  2. try
  3. {
  4.     cn.Open();
  5.     if (cn.State == System.Data.ConnectionState.Open)
  6.         MessageBox.Show("Connection Opened successfully.");
  7. }
  8. catch
  9. {
  10.     MessageBox.Show("Connection failed to open.");
  11. }
  12. finally
  13. {
  14.     cn.Close();
  15. }
  16.  
Jul 20 '07 #3
Plater
7,872 Expert 4TB
The OLEDBConnection object is not defaultly on your toolbar.
However, if you right click and choose to add components(or analogue), you can then select it from the .NET list.

Oh you VB developers, always wanting to make non UI components be on the drag and drop :-P


This might be my new signature...
C# developers ARE smarter than VB developers! ;)
Jul 20 '07 #4
kenobewan
4,871 Expert 4TB
Being clever is the idiot's version of being interesting ;). We VB programmers are well rounded individuals. C# programmers avoid other people interferring in their personal lives by cleverly having none (oops thats a stereotype ;).
Jul 20 '07 #5
Plater
7,872 Expert 4TB
I hate programming :-D
Jul 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: acharyaks | last post by:
Hi life saver, I am using excel component for the development. The purpose is to connect to excel through the odbc connection string. Then through the connection extract data into a dataset and...
6
by: Robert Lawson | last post by:
I continue to get the below error message when trying to load a aspx file. Could someone please point me in the right direction for solving this? I'm trying to access an access data base and I'm...
3
by: COHENMARVIN | last post by:
I put the following code in my asp.net page: dbPath = MapPath("/FBDB/db1_newport2003.mdb") strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" strConnect = strConnect & "Data Source=" & dbpath & ";"...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
1
by: alan | last post by:
in my project there are 5 textbox : tbOrderid, tbSeqNum, tbFoodCode, tbFoodDesc and tbPrice 9 button: btInsert, btdelete, btUpdate, btClear, btBind, btFirst, btPrevious, btNext and btLast i...
2
by: Enska | last post by:
I have problems connecting my access database I get information .. I cant use my database and I'm administrator on my computer so permission shutnot bee problem, but I dont know Where is the...
2
by: dmateer | last post by:
I have the following code in an asp.net page: System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection(); cn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data...
24
by: dancer | last post by:
Using ASP.net 1.1 and Microsoft Access. I received the following error message. Why? I have closed the Access file. I have another very small access file that opens with no trouble with the...
0
by: gobblegob | last post by:
Hello All, I am getting an error trying to update datagridview1 , what i am trying to do is search for an item (BarCode.text) and then display the results to datagridview1 but i just cannot manage...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.