|
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">
|
|
|
|
|
how about this one.. this one might be difficult....
Private Function Decrypt_Key(ByVal bProductKey() As Byte) As String
Dim ilByte As Long
Dim ilKeyByte As Long
Dim nCur As Integer
Dim RetKey As New System.Text.StringBuilder
Dim bKeyChars() As Char = {"B", "C", "D", "F", "G", "H", "J", "K", "M", "P", "Q", "R", "T", "V", "W", "X", "Y", "2", "3", "4", "6", "7", "8", "9"}
For ilByte = 24 To 0 Step -1
nCur = 0
For ilKeyByte = 14 To 0 Step -1
nCur = nCur * 256 Xor bProductKey(ilKeyByte)
bProductKey(ilKeyByte) = Int(nCur / 24)
nCur = nCur Mod 24
Next ilKeyByte
RetKey.Insert(0, bKeyChars(nCur))
If ilByte Mod 5 = 0 AndAlso ilByte <> 0 Then RetKey.Insert(0, "-")
Next ilByte
Return RetKey.ToString
End Function
thank you!!
Im am SUPER P
|
|
|
|
|
I really don't think us writing the code for you is going to help much. We've already helped you with a few conversion, but you're really gonna need to learn how to convert yourself, or use tools that will do the conversion for you. I've already pointed you to Reflector; why not just compile that VB.NET code as a dll (if it's not already), point Reflector at it, and have it generate for you C# code?
Here's a screenshot[^] of Reflector generating C# code from one of my .dll files. As you can see, Reflector generated the C# code for me, even though the dll was written in VB.NET.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
i had it converted on c# on my own without using convertion tools... but i have a problem with this statement when converting it to c#...
vb code ---> bProductKey(ilKeyByte) = Int(nCur / 24)
i tried it on c# code with this code --> bProductKey[ilKeyByte] = (byte)((int)(nCur / 24));
it compiled correctly but it has a different output already......
Im am SUPER P
|
|
|
|