|
"dd-MM-yyyy" is not the problem actually it changes the Registry value to "dd/MM/yyyy" or "dd-MM-yyyy" but in regional settings the date format still remains the same
Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
I am learning visual basic, i have asked questions before and got great answers and oping for a little bit of help again if no one is busy
I am a trainee web designer/developer and have my own website, which i am currently designing. Now i have planned it all out and wish to create a Visual Basic.NET program.
I wish for both the website and the program to have the same logins, both using a MySql database. The website is using a simple script by me for the login at the moment. I didn't want to over complicate it, till i have the Vb program connecting to the database too.
Heres a simple breakdown:
1. Both website and program use same login credentials and same MySql database.
2. Visual Basic program connect remotely to the Mysql database. ( with a shared host )
The program would go about it by basicly starting with a mysql connection then, accessing both username and password tables and checking is Username.TEXT & Password.TEXT match with the database. Once matches, then load up Mainfrm
Sorry for the big message. I have did research on how i would go around doing this. Nothing i can find suggests how i could connect to a remote database on a shared host with (cPanel)
Some of the code im using just now to open the connection, but not sure how to connect to my databse :
Dim connect As New MySqlConnection
Dim sqlcommands As New MySqlCommand
Dim myConnString As String
Dim UserID As Integer
myConnString = "server=" & My.Settings.HostIP & ";" _
My.Settings.HostIP - code i have put in settings file all it contains is my website which doesn't work, of course hehe XD
I have the import mysql client.
Any help would be great thanks. Ofc im not asking someone to do all the work, just asking for some help or ways to improve what i have.
|
|
|
|
|
This tutorial can help you [^]
If you still have errors (after properly initializing the connection string), you should also create mysql user in cPanel and grant connect to the database right.
|
|
|
|
|
Thanks for the reply, the tutorial looks very helpful. Just about to go read it
|
|
|
|
|
Hi,
what is the easiest way to transfer all the records in the dataset to a database? Is there a bulk method what could handle the whole process.
I have populated dataset that identical to database. How can I transfer all the record into database?
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
There's a walk-through from Microsoft Support here[^], with code-examples
I are Troll
|
|
|
|
|
Sorry, I have to ask once more as this is killing me.
My version of VS2008 stops executing on exceptions that are encountered in the try part of the try-catch block. Any ideas about what might be causing that? Is there an opion I'm missing?
ty
|
|
|
|
|
Post some code and maybe someone can help you.
There's nothing left in my right brain and nothing right in my left brain. |
|
|
|
|
|
OK, well for instance, this code throws a NullReferenceException and stops my processing
Dim x
Try
Console.WriteLine(x(0))
Catch ex As Exception
End Try
|
|
|
|
|
Do NOT create empty catch blocks; if you catch an exception, you should act on it, and either report it, or fix the situation, or both.
Which line in the catch block do you want Visual Studio to highlight????????????????????????????????
|
|
|
|
|
I think I am not explaining myself well. What is happening is that VS2008 is stopping execution on the error that is created within the try part of the try-catch block. My understanding (and my prior experience with VS2005) is that the debugger should ignore errors in this part of the block.
ty
|
|
|
|
|
stop being stubborn, add a Console.WriteLine() or some other statement to the catch block, and try again.
|
|
|
|
|
Doesn't matter... same thing.
Dim x
Try
Console.WriteLine(x(0))
Catch ex As Exception
Console.WriteLine("Error")
End Try
|
|
|
|
|
asked and answered here[^].
|
|
|
|
|
cstrader232 wrote: My understanding (and my prior experience with VS2005) is that the debugger should ignore errors in this part of the block.
Your understanding is wrong. When an exception occurs, it is "thrown" upward through the call stack until a catch is encountered or the top of the stack is reached. If you want to have code that runs no matter what you can put it in a Finally block. Or, since this is the VB section, you can use the horrific "On Error Resume Next" construct.
|
|
|
|
|
have you gone to menu tools/options/debugging/general and fooled with those settings?
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Yes, I've tried to change them all.
|
|
|
|
|
click on menu debug then click exceptions. i think you can define it there how you want it to behave. see if that's what your looking for.
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Hi,
So, specifically what is the debugger setting for the NullReferenceException? Your symptoms suggest that it is currently set to break when the exception is thrown.
Alan.
|
|
|
|
|
I have written a console app in VB.net. Basically it reads some information from a couple Excel files, takes the information contained within and goes to that device on our network to poll for more information. This information is then dumped into a new different Excel file.
I am able to run the application via debug and all works great. I can also run it manually via .exe and all works great.
The problem comes in when i attempt to create a scheduled task (every hour) to run as the System user. My error logging shows that it is not able to access the Excel files (which previously worked when run as admin).
I have tried to troubleshoot by specifically setting the file permissions for that folder/file for the System user.
Could someone shed any light on why I am running into this problem?
Thanks!
-Steve
|
|
|
|
|
a lot of errors like this are caused by account issues - the scheduler usually runs as a particular account - with no standard user environment - so try to fully specify paths etc to the files. Depending on the o/s, you could change the scheduler to use a particular account's credentials - this may throw other scheduled apps out, especially if they require desktop/gui access
The other thing I do is use a 'runas' type program to impersonate the user, including load the registry hive etc, so that the environment is correct - the [in this case 'Excel manipulation program'] is then running under a real user not a limited system account
{ps : I use tqcrunas from a company called 'Quimeras' - Im not affiliated with them in any way, but its a great product that allows me to encrypt/protect credentials/command sets - they are really good at support btw}
'g'
|
|
|
|
|
1. All file paths are absolute.
2. The scheduler for 2008 needs the System account to run scheduled tasks without being logged in as far as I have been able to tell. I have a scheduled task to download a weather map every 10 minutes and would only run using the System account.
3. I attempted to use runas via the command line for the System user however, the password was prompted for, which is not known.
|
|
|
|
|
reply to 3. yep, thats the issue with the standard runas - there are some programs Ive seen that allow you to pass a password to runas
Can you create a seperate user account and test the excel bit under that - if you can use 'runas' and your user account to run the excel bit, then you can use one of the other [encrypted] runas tools I suggest to finish the automation
I still think its your system account vs COM components that EXCEL might be using thats giving you the issue - Ive had the same issue on Windows 2003 server
'g'
|
|
|
|
|
in addition to the tqcrunas product [just to prove Im not biased], Wingnut software also make such a product
http://www.wingnutsoftware.com/[^]
see 'Encrypted runas'
'g'
modified on Sunday, December 27, 2009 9:21 PM
|
|
|
|
|
I have created a query in VB6.0 using MSHFlexGrid. My database is in Microsoft Access 2003. I know how to search the records having a single field (eg:Customer name= "Alex") and get the results displayed in the MSHFlexGrid.
But I need to know how to code a search condition which will display records containing 2 fields (i.e to give 2 parameters to the Condition).eg:How to view the records having Customer name: "Alex" and Sex:"Female". Please, tell me how to do this. I will be deeply grateful for your help!
|
|
|
|