Click here to Skip to main content
15,914,444 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
HI,

Currently I have open office database. Now I need to get that database data to c# windows form application. I want to connect the open office database with connection string and get the dataset from c#. Can any one help me.
Thank you,
Posted
Comments
Bernhard Hiller 8-Jun-12 4:06am    
It's an interesting question. I followed Abhinav's link and did not find anything useful: there are many drivers for retrieving data from other database into OpenOffice database, but no hints at all for conencting from a .Net application.
Perhaps you could ask your question also in a OpenOffice developer forum, and StackOverflow - in case you get a useful answer there, please come back and tell us.
Soft009 8-Jun-12 4:29am    
Thanks a lot, I'll submit this in the Open office developer forum. Definitely I'll come back. :)

https://wiki.openoffice.org/wiki/Database/Drivers/MySQL_Native/1.0[^]

This has your and mine aswers
:)
Peace Out Buddy
 
Share this answer
 
I just want to set the connection with the database in c#
Yes it is possible, for that you have to follow some steps:

1) First add
C#
"using System.Data.OleDb;"
at to top of the CS file.

2) Create connection string and open connection.
For access 2007
C#
string ConnStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\abc.mdb;Jet OLEDB:Database Password=password";

OleDbConnection MyConn = new OleDbConnection(ConnStr);


3) Open this connection.
MyConn.Open();


4) Create object for command and reader to get the data from access database.
C#
OleDbCommand Cmd =  new OleDbCommand(StrCmd, MyConn);;
 OleDbDataReader ObjReader = Cmd.ExecuteReader();


5) Now lood through the reader object to get the data

C#
if (ObjReader != null)
{

}


6) After completing the processing
C#
ObjReader.Close();
MyConn.Close();
 
Share this answer
 
Comments
Soft009 7-Jun-12 0:28am    
Thanks for the answer, I know the connection for the access database. I want it for "Open Office base" for "newdatabase.odb"
seyohan 30-Mar-13 9:50am    
do you find a solution?
http://wiki.services.openoffice.org/wiki/Database[^] should provide you with some solutions.
 
Share this answer
 
Comments
Soft009 6-Jun-12 23:36pm    
Thank you,
I just want to set the connection with the database in c#. Is it possible.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900