473,946 Members | 16,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using ODBC with C# 2005 Express Edition

Hi

I have some paradox db's i need to connect to. I have figured out that
i can do this using ODBC, however C# Express edition does not support
this connectivity easily and must be done programmaticall y. I have a
class to do this:

public static class Data
{
public const string SelectAllComman dText = "select * from
WindowInfo";

public static string ConnectionStrin g;

public static DataSet GetWinInfoDataS et()
{
if (string.IsNullO rEmpty(Connecti onString))
throw new ArgumentNullExc eption("Connect ionString");

DataSet result = new DataSet("WinInf o");

using (OdbcConnection connection = new
OdbcConnection( ConnectionStrin g))
{
using (OdbcCommand command = new
OdbcCommand(Sel ectAllCommandTe xt))
{
command.Connect ion = connection;
using (OdbcDataAdapte r dataAdapter = new
OdbcDataAdapter (command))
{
dataAdapter.Fil l(result);
connection.Clos e();
}
}
}
return result;
}
}

Which seems OK.
Need nelp on how to populate/bind a datagridview on my form. How can
tweak the code below to do this?

private void FormMain_Load(o bject sender, EventArgs e)
{

Data.Connection String = Settings.Defaul t.ConnectionStr ing;

dataSet1 = Data.GetWinInfo DataSet();
bindingSource1. DataSource =
dataSet1.Tables["WindowInfo "] ;
dataGridView1.D ataSource = bindingSource1;

}
Many Thanks

Colin Williams

Jun 14 '07 #1
7 5885
On Thu, 14 Jun 2007 13:39:40 -0700, Colin Williams
<co************ **@msn.comwrote :
I have some paradox db's i need to connect to. I have figured out that
i can do this using ODBC, however C# Express edition does not support
this connectivity easily and must be done programmaticall y. [...]
You multi-posted this to at least two different newsgroups (this one and
m.p.dotnet.fram ework). Please learn to cross-post properly by including
all newsgroups in the Newsgroups: field of the same post.

Thank you.
Jun 14 '07 #2
On 14 Jun, 22:40, "Peter Duniho" <NpOeStPe...@nn owslpianmk.comw rote:
On Thu, 14 Jun 2007 13:39:40 -0700, Colin Williams

<colinwilliams. ..@msn.comwrote :
I have some paradox db's i need to connect to. I have figured out that
i can do this using ODBC, however C# Express edition does not support
this connectivity easily and must be done programmaticall y. [...]

You multi-posted this to at least two different newsgroups (this one and
m.p.dotnet.fram ework). Please learn to cross-post properly by including
all newsgroups in the Newsgroups: field of the same post.

Thank you.
Peter

Apologies for the incovenience this must have caused. I will look into
cross posting.
Regards
Colin Williams

Experience is something you dont have until just after you need it. ;)

Jun 14 '07 #3
Colin,

It looks like it is doing it just fine. Is it not showing anything, are
you getting an exception? More information is needed.
"Colin Williams" <co************ **@msn.comwrote in message
news:11******** **************@ i13g2000prf.goo glegroups.com.. .
Hi

I have some paradox db's i need to connect to. I have figured out that
i can do this using ODBC, however C# Express edition does not support
this connectivity easily and must be done programmaticall y. I have a
class to do this:

public static class Data
{
public const string SelectAllComman dText = "select * from
WindowInfo";

public static string ConnectionStrin g;

public static DataSet GetWinInfoDataS et()
{
if (string.IsNullO rEmpty(Connecti onString))
throw new ArgumentNullExc eption("Connect ionString");

DataSet result = new DataSet("WinInf o");

using (OdbcConnection connection = new
OdbcConnection( ConnectionStrin g))
{
using (OdbcCommand command = new
OdbcCommand(Sel ectAllCommandTe xt))
{
command.Connect ion = connection;
using (OdbcDataAdapte r dataAdapter = new
OdbcDataAdapter (command))
{
dataAdapter.Fil l(result);
connection.Clos e();
}
}
}
return result;
}
}

Which seems OK.
Need nelp on how to populate/bind a datagridview on my form. How can
tweak the code below to do this?

private void FormMain_Load(o bject sender, EventArgs e)
{

Data.Connection String = Settings.Defaul t.ConnectionStr ing;

dataSet1 = Data.GetWinInfo DataSet();
bindingSource1. DataSource =
dataSet1.Tables["WindowInfo "] ;
dataGridView1.D ataSource = bindingSource1;

}
Many Thanks

Colin Williams
Jun 14 '07 #4
Thanks for the reply
No exceptions, but no records are being returned to the grid either.
Im stumped.

Regards

Colin Williams


On 15 Jun, 00:44, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guar d.caspershouse. comwrote:
Colin,

It looks like it is doing it just fine. Is it not showing anything, are
you getting an exception? More information is needed.

"Colin Williams" <colinwilliams. ..@msn.comwrote in message
Jun 15 '07 #5
Colin,

Are you sure about that? In Windows Forms, when an exception occurs in
an event handler, it is swallowed by the control. You need to wrap the code
in the Load event in a try/catch block and step through it in order to see
if there is an exception.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Colin Williams" <co************ **@msn.comwrote in message
news:11******** **************@ q66g2000hsg.goo glegroups.com.. .
Thanks for the reply
No exceptions, but no records are being returned to the grid either.
Im stumped.

Regards

Colin Williams


On 15 Jun, 00:44, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guar d.caspershouse. comwrote:
>Colin,

It looks like it is doing it just fine. Is it not showing anything,
are
you getting an exception? More information is needed.

"Colin Williams" <colinwilliams. ..@msn.comwrote in message
Jun 15 '07 #6
Nicholas

Tried your advice and no exceptions. I have now solved the problem by
adding the table name to the dataAdapter.fil l() method.
i.e
dataAdapter.Fil l(result,"table name");
Many thanks for you help.

Colin Williams

On 15 Jun, 14:45, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guar d.caspershouse. comwrote:
Colin,

Are you sure about that? In Windows Forms, when an exception occurs in
an event handler, it is swallowed by the control. You need to wrap the code
in the Load event in a try/catch block and step through it in order to see
if there is an exception.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard .caspershouse.c om


Jun 17 '07 #7
Now i can see the data except for the blob fields. This i anticipated.
How do i go about retrieving these?

Jun 17 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1523
by: the friendly display name | last post by:
The 2003 product line, had the standard editions, you could only work with one single language, but, ASP.NET AND windows forms development was possible, and it wasn't that dumbed down. The price for a std edition: around 100$ Sadly, there isn't a true successor to those editions in the 2005 product line. There is a standard edition, but it costs 300$, although it supports now more than one language.
1
1896
by: Lubomir | last post by:
Hi, I would like to ask, how different are C# 2005 Express Edition and C# within MS Visual Studio 2005. Than as well Visual Web Developer 2005 Express Edition and ASP within MS VS 2005. Thanks, Lubomir
4
6134
by: james | last post by:
Thought I would let everyone know that Visual Basic 2005 Express Edition is now available for download: FREE............ Until I can get Visual Studio 2005 PRO ( or maybe even Standard Edition) this will at least keep me going! Here's the link for those interested: http://msdn.microsoft.com/vstudio/express/vb/
1
7157
by: QLD_AU | last post by:
Has anyone see the following error ? VS 2005 Installs ok, however the SQL Mobile Edition (part of a full install) fails with the following error ? With Thanks Jason
1
6654
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an unexpected value. ***EndOfSession***? Microsoft SQL Server 2005 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an...
5
2714
by: R.A.M. | last post by:
Hello, I am learning SQL Server 2005 Expres Edition. I need to create full text index on Books.Remarks column in my database. I tried: CREATE FULLTEXT CATALOG FTC_Books AS DEFAULT CREATE FULLTEXT INDEX ON Books (Remarks) KEY INDEX IX_Books_Remarks ON FTC_Books Unfortunately I got error:
45
3042
by: mistral | last post by:
Does Visual C++ 2005 Express Edition produce small, compact C executables? Or there is another C compilers that do this better? m.
2
1507
by: =?Utf-8?B?QW50aG9ueSBSb2RyaWd1ZXosIERCQQ==?= | last post by:
Hi! I downloaded MS Visual Web Developer 2005 Express Edition, MS .NET Framework SDK v2.0, and MS SQL Server 2005. Subsequently, I bought MS Visual Studio 2005 Professional Edition. 1) Are both the MS Visual Web Developer 2005 Express Edition and the the MS Visual Studio 2005 Professional Edition used to develop .ASP Web pages? 2) Do I have to uninstall any of the software downloaded before I can
3
3415
by: hsmit.home | last post by:
I spent way too much time on this and I must say, I was a little disgruntled with what has been posted on all the various Xalan C mailing lists. Everyone says there's a solution, but give next to no detail on how to achieve this "allusive" solution. Well I spent the better part of a day finally figuring it out the hard way, trial and error. Here's a list of steps to compile the Xalan C version 1.10.0 on Microsofts Visual C++ 2005...
0
9974
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11140
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10679
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8240
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6317
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4928
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3524
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.