|
What is the error you are getting?
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
"System.Data.OleDb.OleDbException: Could not find file 'D:\\AttendanceDB.mdb'.\r\n at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)\r\n at System.Data.OleDb.OleDbConnection.InitializeProvider()\r\n at System.Data.OleDb.OleDbConnection.Open()\r\n at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)\r\n at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)\r\n at SanMarCalendar.SanMar.cmbGroups_SelectedIndexChanged(Object sender, EventArgs e) in d:\\sanmar\\sanmarcalendar\\forms\\sanmar.cs:line 1338"
i never even told it to set it to that file or any other file the proper location of the file is set by default to ../../AttendanceDB.mdb but for some reason whenever i use an openfile dialog it sets it to the above. and gives me this exception why is openfile dialog changing my oledbConnection string
|
|
|
|
|
Have you tried giving the connection string the entire physical path of the DB just to see if it still does it? Mabey you could try changing the path so something like:
Application.StartupPath() + "\AttendanceDB.mdb";
and see if it still gives you the error.
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
the connections all work fine untill i open the open file dialog then they all die once i try to use them after the open file dialog
it actualy looks like whenever i call fill on an adapter it dies after the open file dialog
the open file dialog has nothing to do with the database stuff.
|
|
|
|
|
This is more-than-likely because your connection string isn't specifying a complete path to your database, something like "DataSource=mydata.mdb". Since you left out the fully qualified path, it is assumed that the database is in the current directory.
The OpenFile dialog will change the current directory to whatever was picked in the dialog, thereby breaking the path to your database. ALWAYS use fully qualified paths when working with any kind of files.
string dbPath = Path.Combine(Application.StartupPath, "myData.mdb");
string connString = String.Format("blah;DataSource={0};", dbPath);
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am writing a small program to check some services in W2k3 using C#. It's kind of simple to get the services name as well as their statuses, but I don't know how to get their logon (logon as what account) and recovery information.
Anyone knows how to do that?
Thanks much,
Johnny
|
|
|
|
|
Hi everyone,
For a quite complicated and boring purpose, let's say a project for the university, I have to find a way to create a pointer on an array of int. It sounds easy and in C++ it would take 1 second. But in C#, I don't know how to do that. Has someone an idea?
I let you a few lines of code that does NOT compile because it tries to get a pointer from a managed type:
unsafe
{
int* ptr;
int [] array = new int[SIZE];
ptr = &array;
}
the same error appears with an array of float or of byte.
I have tried to use the 'fixed' keyword, but that didn't help neither.
|
|
|
|
|
int[] array = new int[50];
fixed (int* parray = array)
{
...
}
|
|
|
|
|
Hello,
Which is the accepted practice in .NET coding, to just throw everything in a single project into a single namespace, or to separate different parts of a project into different sub-namespaces?
For instance, should I put all structures into a namespace called "Project.Structures", and then put all dialogs into "Project.Dialogs", and so forth?
Thanks,
Rich
|
|
|
|
|
Troposphere wrote: throw everything in a single project into a single namespace
If it is a small throw away application then that would be acceptable.
Troposphere wrote: separate different parts of a project into different sub-namespaces?
Yes. And split the solution into multiple projects.
Troposphere wrote: should I put all structures into a namespace called "Project.Structures", and then put all dialogs into "Project.Dialogs", and so forth?
Typically I'd say a layering patter would be better (you can, of couse, split the layers in to finer grains if you want). I'd have a UI project, a business project, and a data access project. The reason for that is that it prevents circular references. Your UI project referenced the business project, and the business project references the data access project. If any other references between these projects needst to be set up then I know I'm doing something wrong.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Somebody knows how to make windows hide automatically like the Solution Explorer in Visual C#?. Is there any class wrapper or something??
Sorry for my english...
|
|
|
|
|
DockPanelSuite on SourceForge. Sorry no direct link
|
|
|
|
|
i don't know. but u can make it manually using timer when expire hide the form and open a new form
|
|
|
|
|
Hi,
I create an user control, and use the following code to create it, is the code ok?
private void func(){
myctl mc=new myctl();
Panel1.Controls.add(mc); //panel1 is a panel I put in a form
mc.show();
}
it works fine, but I think mc should out of range(be destroyed automatically) once the function call end.
Or the controlcollection of the Panel control still keep it alive???
I am listening .....
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
It will be kept alive until there are no more references to it. Since it is referenced by panel1's Controls collection, it will be kept alive at least until it is either removed from that panel or the panel is disposed and no longer referenced.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
Thanks!!
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
Hi,
I hope it's just a simple question. When I unintall my .NET/C# program that I installed using my own setup programe, the program shortcut in the start menu doesn't get cleaned up completely. The content is removed but the folder remains. How can I remove the folder at uninstallation time? Thanks for help!
John
|
|
|
|
|
Why would you be using your own setup program
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
Sean89 wrote: Why would you be using your own setup program
I meant the setup I created using .NET Setup and Deployment project.
|
|
|
|
|
I am trying to connect to my SQLServer, and i get the message that login faild to my user:
Login failed for user 'YOS-GB5VYJ57W5W\ASPNET'.
why is that?
do i need to change the user?How?
the string that i use is:
mycon = new SqlConnection("Data Source=localhost;Database=RTQ;Integrated Security=SSPI");
Thank you
|
|
|
|
|
are you using this code in a webservice? If so, you'll have to add the aspnet user with nt authentication to your sql server logins, then as a user for the RTQ db. Otherwise you'll have to use trusted_connection = no and supply a userid and pwd in your connection string.
BugReporter[^]
BlackDice
|
|
|
|
|
I am not using webservice, i am using webaplication.
where can i give the permissions to log in to RTQ?
with the SQLServer Enterprize??
Thanks
|
|
|
|
|
In your sQL server Enterprise manager, click on the node for your server, right-click logins, select 'add new login' add that name you got the error on (domainorcomputername/aspnet) select NT authentication, then I think it's on another tab, select the rtq db for that user.
Some Pictures[^]
BugReporter[^]
BlackDice
|
|
|
|
|
The problem is that you are using Windows Authenitication to connect to SQL Server in a ASPNET Application, you can do one of three things:
1. Remove this from the conection string "Integrated Security=SSPI" and change it for:
"user=my user;pwd=mypassord"
2. Add this in the web.config
<idenity username="DOMAIN\myUser" password="Type UserPasswer">
3. Go the SQL Server and add the ASPNET user as windows user login, that can read and write on that databases you need.
Greetings,
Felipe
|
|
|
|
|
2. Add this in the web.config
<identity userName="DOMAIN\user" password="mypassword">
|
|
|
|