sharing connections between applications  
Author Message
AlexBB





PostPosted: Visual FoxPro General, sharing connections between applications Top

sharing databases between applications.

This is the thing. I have a VFP application which is 99% complete. Occasionally I add some embelishments or premium features. I am also in the process of developing a C# app of Winsock style. It is a console app in Visual Studio 2005. It is supposed to use some of the same ODBC VFP9 databases. I've read that VFP databases are much superiod to SQLServer databases in terms of speed. I spent a day trying to figure out why I could not open a connection while my VFP app was open all the time and those databases were linked to it. Finally, even superstupid get their break and I realized that there was nothing wrong with my connection string. I shut the VFP app down. This brings me to the question as to how to manage both apps because after I am done with C# I will need both of them.

I will most likely figure it out on C# side tomorrow or in a couple of days. It someone has stellar experience on this issue and I mean primarily Dave or Cetin but anybody else's advice will be also welcome, I would appriciate any comments including in C# area. So far all my databases have been opened on VFP side exclusively. Any available code in VB can be of course converted to C#. Mine is OLEBD.NET connection on C# client side, not ADODB.

I will both read from VFP databases into C# app and write into them but into different tables altogether (at least the way I picture it at present).

Many thanks in advance.




Visual FoxPro2  
 
 
Tamar E. Granor





PostPosted: Visual FoxPro General, sharing connections between applications Top

Your question contains your answer. You need to open both databases and tables shared if you want to use them from more than one application (or even more than once in the same application) at the same time.

Tamar

 
 
AlexBB





PostPosted: Visual FoxPro General, sharing connections between applications Top

Thank you Tamar. I am almost done with my C# project and soon will do some test runs.

Is there any danger in opening the databases shared

Thanks.



 
 
CetinBasoz





PostPosted: Visual FoxPro General, sharing connections between applications Top

Practically no. It only has dangers as with any other database system (like you'd decide what to do if 2 users are updating the same record). IOW you can think of your C# + VFP as 2 VFP or 2 C# multiuser application.

Along the lines I read ODBC in your message. My suggestion forget ODBC and use VFPOLEDB instead (OleDbConnection).

As per speed between VFP and MSSQL, being primarily a foxhead, I'd too like if VFP was faster but I can't say that. MSSQL 2005 has many more undeniable plusses (hey comparison simply is not fair - my simple rule, if you have a chance to use MSSQL, use it else VFP. You can even mix them.).

 PS: Since you're completing it probably you would not interested but have you ever thought of remoting instead of winsock programming directly (or maybe I got it wrong).


 
 
AlexBB





PostPosted: Visual FoxPro General, sharing connections between applications Top

Practically no. It only has dangers as with any other database system (like you'd decide what to do if 2 users are updating the same record). IOW you can think of your C# + VFP as 2 VFP or 2 C# multiuser application.

Along the lines I read ODBC in your message. My suggestion forget ODBC and use VFPOLEDB instead (OleDbConnection).

As per speed between VFP and MSSQL, being primarily a foxhead, I'd too like if VFP was faster but I can't say that. MSSQL 2005 has many more undeniable plusses (hey comparison simply is not fair - my simple rule, if you have a chance to use MSSQL, use it else VFP. You can even mix them.).

PS: Since you're completing it probably you would not interested but have you ever thought of remoting instead of winsock programming directly (or maybe I got it wrong).

Cetin, thank you. I just read your post since I seldom now come to visit here. No time. Your comment on MySQL is of considerable value for me. I will focus on it for another project for sure. Actually I have already installed a server.

I do use VFPOLEDB connection to the VFP tables. It turned out to be the only solution or rather the easiest one.

I actually came here for another post of yours. It seems to me it has been wiped out. Did you remove it as the author There was some C# code in it and I did not save it. Now I regret.

I do have a situation now with another database (also VFP) where I read tables into C# with OleDbConnection but do not want to use XML for sending the data back. I thought that I should look at your sample but now it is gone. I think you gave an example of that.

One of my posts in this thread has also disappeared. Very funny. That post of course is of no value for me.

You should trespass over to C# General. You will have fun. And also your knowledge will be helpful for a lot of folks over there.

Thanks.



 
 
AlexBB





PostPosted: Visual FoxPro General, sharing connections between applications Top

Sorry, I goofed up (as usual). It was in another thread. My post is safe.

There is so much stuff to deal with. I get confused momentarily.



 
 
CetinBasoz





PostPosted: Visual FoxPro General, sharing connections between applications Top

Probably you meant this one:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=750871&SiteID=1

I tried C# forum once but it was hard to track my posts so I regreted. MSDN forums looks like is only suitable for low traffic (or because I'm accustomed to universalthread's ease of use and there I'm member both on VFP and .Net forums).