|
Hi,
Try by changing your query to this..
select name from sys.databases
If this has not worked properly, show the exception message.
with regards
Karthik Harve
modified 23-Apr-12 7:23am.
|
|
|
|
|
i want to display the list of access database names in a combobox, i get an exception
public static List<string> GetDataBasesNames()
{
cnx = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0");// how I can connect to Access without specifying the database, I want to retrieve all the names of databases
cnx.Open();
List<string> DtataBaseNames = new List<string>();
OleDbCommand cmd = new OleDbCommand ("SELECT Name FROM sys.database", cnx);
OleDbDataReader rd = cmd.ExecuteReader();
while (rd.Read())
{
DtataBaseNames.Add(rd.GetString(0));
}
return DtataBaseNames;
}
|
|
|
|
|
Repeating your OP verbatim is not helpful.
|
|
|
|
|
MemberDotNetting wrote: how I can connect to Access without specifying the database, I want to retrieve
all the names of databases
You don't. What you are trying to do is not possible to do with an Access database. Access databases are individual files and are not hosted in a server like SQL Server.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
You can't do that. There is no such thing as an Access Database Server that maintains a list of every database registered with it. That's not how Access works.
Access is a desktop file-based database. Every database is its own seperate entity. There is no such table of databases anywhere.
The only way to do what you want is to search the hard drive for files ending in the supported extensions. That list varies depending on which version of Access is installed on the users machine.
|
|
|
|
|
Hi,
I am building an application that uses Exchange Web Services (EWS). Everything that I have build works except retreiving a list of calender rooms from Exchange. In Microsoft Exchange Console I have created 3 different rooms. In my C# code I want to list this three rooms. This is my source code:
EmailAddressCollection myRoomLists = service.GetRoomLists();
foreach (EmailAddress address in myRoomLists)
{
Console.WriteLine("Email Address: {0} Mailbox Type: {1}", address.Address, address.MailboxType);
}
But no room lists will be returned with this source code! Why?
Mr BigSpender
|
|
|
|
|
Håkan Axheim wrote: service.GetRoomLists();
Obviously the line above is not returning anything. Some settings maybe?
|
|
|
|
|
The method GetRoomLists takes no parameters so where can I set the settings?
|
|
|
|
|
A config file perhaps / exchange settings?
|
|
|
|
|
Vvrooooomm!
Fast enough for you?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Do you have a source code of that GetRoomLists() method? Maybe you should look there.
Greetings - Jacek
|
|
|
|
|
Hi all,
I am developing a c# windows application and creating a setup of it.
When i install that application i want a feature like - when i right click on a file i will get a context menu in which i want to display the application name with the path.
So that when i click on the application some operation will be done on that file.
All this things i want to do it in c#.
Please can any one tell me how can i do it.
Thanks in advance.
|
|
|
|
|
Look for "file type association". It is done in the registry (you can add some registry keys by your setup project). Another possibility is to start the application immediately after install and have it creating the keys, see System File Association[^].
|
|
|
|
|
You need to create a custom action in your setup.
This[^] should give you an idea.
|
|
|
|
|
I am developing a windows desktop application in c# using an MS Access DB in Back end. I am putting some values in DB using MS Acess, the Db is liked to a c# code. Till Exexution everything is fine. But when execution ends the Values disapper from the database which i have inserted before running it. Please Help.
|
|
|
|
|
Are you sure that your program is pointing at the correct DB file?
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Yes there is only on file and i am pointing it only.
|
|
|
|
|
Are you beginning a transaction and not committing it before you exit?
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
yes i tried commiting it too.
|
|
|
|
|
Typically this happens because you added a Access database to your project and, in the Properties for the MDB file, it's tagged Copy Always.
So, every time you run the project, the .MDB file is copied to the BIN folder with your .EXE. Your .EXE then writes new data to the file. The next time you run the project, the MDB file is copied over the top of the file you modified, thereby your data from the last run disappears!
|
|
|
|
|
Hello World!
what I want to do is I want to list every possible combination with alphabet A-Z (only capital) and number 0-9 (Permutations).
I mean something like follow :
C42D5V2DC5V1D23C
AAAAAAAADDD44444
111111111111111A
NNNNNNNNNNNNNNNN
ALL possible modes.
|
|
|
|
|
Well, that seems straightforward enough. The only real issue you have to worry about is whether or not to make the algorithm run in parallel.
|
|
|
|
|
There are 7,958,661,109,946,400,884,391,936 (3616) of these permutations. Are you sure you want them all?
|
|
|
|
|
BobJanova wrote: There are 7,958,661,109,946,400,884,391,936 (3616) of these permutations combinations (with repetitions). Are you sure you want them all?
FTFY. There are 7,307,872,110 permutations.
Greetings - Jacek
|
|
|
|
|
Good point. But that's what the OP actually asked for, I got confused by his mistaken use of the word.
I still get 152,901,072,685,905,223,680,000 for permutations, though (36×35×...22×21).
|
|
|
|