|
sorry for my previouis reply... you can do it this way
dim connection as string = "YourConnectionString"
dim instance as sqlcommand = connection.createcommand
try
instance.commandtext = "Delete * from [TableName]"
instance.commantype = commandtext 'pls this line for sintax
instance.connection.open()
instance.executenonquery()
catch
messegebox.sho(ex.message)
finally
instance.connection.close()
instance.dispose()
end try
'hopes this helps.
|
|
|
|
|
Hi,
I created a database that store the chinese character in mysql. When I retrive these data by :
SELECT * FROM table_name
and display the data in the listview in vb.net, the data become ???. Anyone can help me on this?
Thanks.
|
|
|
|
|
Well, characters in .NET are saved as Unicode Big Endian, which contains almost no Chinese characters, so the problem should be to encode the characters as UTF8.
|
|
|
|
|
My company has been asked to have software follow the users. Software is typically deployed using a software deployment system, Tivoli. This only deploys software to the workstations via Tivoli endpoints (Clients) installed on the workstations. Being this is a Microsoft environment, we have also been asked to incorporate the use of AD to assign users to groups.
The process works as follows:
1. User is assigned to an application group in AD
2. User receives a shortcut on their desktop using group policy
3. User clicks on the shortcut which points to a VB script on a file server.
4. Script opens a VB message box that asks the user if they would like to install the software, YES/NO
5. User clicks NO script ends and the VB Message box closes
6. User clicks YES and the script sends a message to the Tivoli endpoint (client) on the workstation requesting the software package from Tivoli
7. The VB message box closes, and the user just has to wait for the software to be installed by Tivoli.
This works great but...... the user has no idea that the software is installing, or when the software installation is complete.
What I need help with is 2 things:
1. Getting a message box stating "Your software is being installed" to stay on the screen till the software is installed the software is being installed
2. Getting a message box stating "Your software has been installed, please click OK" when the software installation has completed.
Some thoughts:
1. When the MSI is installing the software package, it will ALWAYS leave a log file in the C:\windows\temp directory called xxxx.log where xxxx is the name of the software.
2. The log will always have a line at the end that looks like this: [101007] ****** xxxxxx has successfully been installed.
3. I think that if I could add a section in my VB script that looked for the xxxx.log log file, and then after finding it kept reading it until it found the last line ****** xxxxxx has successfully been installed.
4. While it is looking for the last line, the message box stating "Your software is being installed" to stay on the screen till the software is installed
5. Once the last line is found, the message box stating "Your software has been installed, please click OK" would appear.
'-------------------------------------------------------------------------
'Created date: August 2006
'--------------------------------------------------------------------------
'
'
Const ForReading = 1
Const ForWriting = 2
'Prompt User that software needs to be installed
sMBVB_Msg = ""
sMBVB_Msg = sMBVB_Msg & "This software is being used for the first time, and must be installed. " & vbCr
sMBVB_Msg = sMBVB_Msg & " Click Yes to install the software, or NO to exit."
sMBVB_Title = ""
sMBVB_Title = sMBVB_Title & "WinZip v9.0"
lMBVB_Type = vbYesNo
lMBVB_Type = lMBVB_Type + vbQuestion
lMBVB_Type = lMBVB_Type + vbDefaultButton3
lMBVB_Type = lMBVB_Type + vbMsgBoxSetForeground
iMBVB_ReturnCode = MsgBox(sMBVB_Msg, lMBVB_Type, sMBVB_Title)
'If answer is yes, then 'Install Software
If iMBVB_ReturnCode = vbYes Then
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "%comspec% /C C:\Progra~1\TIVOLI\TIVPOST\POSTEMSG.EXE -S tmrdev -r HARMLESS -m Winzip-v9_Defaultv1.0 hostname=%computername% Workstation_Build user",1,True
End If
'If answer is no then exit install
If iMBVB_ReturnCode = vbNo Then
WScript.Quit
End If
'--------------------------------------------------------------------------
Any help getting the script to find and parse the file to the end, and then perform an action would be greatly appreciated.
pdg777
|
|
|
|
|
This has "Awful Nightmare" written all over it. Although it is possible to do, there are far better software metering solutions. Your biggest problem is going to be licensing. For example, you can't just install Office (a HUGE install for Tivoli!) on any number of workstations you want. You'll have to uninstall the software before you can install it somewhere else. Another problem is bandwidth. Installing and uninstalling the same apps constantly can choke a network. Just imagine copying out the 500MB app to 10 workstations all at once. Not to mention the mandatory reboots that some software installs require.
Another problem you have is monitor the log file. Tivoli installs are totally background and it's not known for doing thing very quick. Tivoli is lazy, to say the least. What happens when the user logs off or reboots the workstation and doesn't log back on?? Your script won't be running to monitor the success or failure.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave,
You are right, it could be a nightmare. However this will only be for Unique applications, and not core applications. In other words, Office will and other core packages will already have been installed by Tivoli. Licensing is a concern, but since the users don't move around, application creep should not be an issue, but will be a concern.
|
|
|
|
|
pdg777 wrote: Licensing is a concern, but since the users don't move around,
Uhhh..."My company has been asked to have software follow the users." So why are you doing this again?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave, can you help here? We want unquie apps to follow the user if required. Core apps are installed, by default. Can you help with the bit of script I am not understanding?
|
|
|
|
|
You really don't have a scriptable UI you can use to do this. About the best you can do with Tivoli is to read a configuration file that describs what software is supposed to be installed, check to see if those packages are installed, and if not, launch the command line for Tivoli to install them. You don't really have an option for monitoring the installs and giving any kind of interface to the user.
The problem is you really have no way of reliably tracking what Tivoli is doing and pairing that up with what is scheduled unless you want to write a complete parser for the Tivoli logs to TRY and understand what's currently going on. The issue with doing that is Tivoli is so lazy, you can check for something one minute and it's not happening, but come back in 5, 10, 20, ..., minutes and the software is distributing, but which one. Try looking through the lcp.log file and matching that garbage up with what is supposed to be going on.
The problem isn't really with your scripts. It's with Tivoli's laziness and lack of interfacing with a client-side application that is going to cause you problems.
There isn't really a good script you could write to cover all of the issues you have.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
[VS 2005]
I have tried and failed to get rid of the let hand border of the datagridView. It is the one that has the little black arrow. Not sure if it is possible to not show it.
Does anyone have any ideas on how to get rid of the border. I have searched the properties and styles but could not find anything.
Many thanks,
Steve
|
|
|
|
|
There are various properties available to do so, Can you past the code details here both aspx and code behind details...
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
|
|
|
|
|
Not sure but it sounds like you want to get rid of the row header? If so, you can do this: datagridviewname.RowHeadersVisible = false Hope that helps
|
|
|
|
|
Hi!
I have DO WHILE LOOP and I placed Application.Dovents necessarily inside the loop. I just wonder would it be possible to make the loop hanging for a specific of time but same time I should be able to perform other actions in application. I decided to use System.Threading.Thread.sleep() but it is locking the application for defined time and Application.Doevents becomes useless. I need your advice. The scenario is held inside a private procedure. I wish there would be a statement to suspend processing of a procedure inside the application for specific of time
Thank you all.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Would you not first create a new thread for your DO WHILE LOOP and System.Threading.Thread.sleep() that one and not the app. thread?
Jelle
|
|
|
|
|
Thanks for replying. I am just new about threads in vb.net and I couldn't find an example how to create a new one. The application.wait also hangs the whole application.
Actually it is a game project user versus to computer in making words with given letters. But it takes only a second for puter to come up with words. Therefore, I want to make puter waiting for a specific of time before it places words on the board. This action is held inside a Do WHILE LOOP and I eventually placed Application.Doevents for user inside the loop. The puter has to wait inside the loop. Eventually I can solve the problem but I was looking for a statement for that.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
If your not running the code on a secondary thread then the only way I believe is what I think you've already done. Use a loop that loops for a specified period of time and use application.doevents inside the loop so it doesn't lock your application.
If you use a secondary thread to do the processing you could just call threading.sleep. But doing so on the UI thread will as you've discovered cause the UI to appear hung.
If you'd rather use a secondary thread look into the backgroundworker component. It's pretty easy to use.
|
|
|
|
|
With the additional info I believe your approach is over complicating things.
I would use a new thread for a complicated and time consuming task where the app can do better things then just waiting. Yours however, if I understand you right, has a "simple" and "Quick" task you like to delay.
Better not take that task and only start it after the delay? You could just use a timer to start it. If it is essential that the "computer" is producing it's answer character by character then maybe it is the "adding characters bit" you want to delay? This possibly allows a re-compute of the computer task if it needs to respond to users input. Is all that relevant?
I am looking forward to your comments.
Jelle
|
|
|
|
|
Thanks Jelle! I did so and now it is working.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
i need a way to make a demo software that run for a limit date
if this soulution in using registery how could i make
the registery safe because any body can access registery
and changed the value plz
ahmad
|
|
|
|
|
You really can't do much more than anyone else does, which is to hide the values in either a file, or the register. A common way to do it, is to have a couple of files called xxx.dll ( whatever ) in your app directory, and have junk in them. Just modify specific bytes in those files to store things like the date the app will expire, and the last date the app was used. You need the latter to work out if time ever goes backwards. If it does by more than an hour ( don't forget daylight savings time ), then odds are the user is playing around to kill your protection. But, don't forget about people who travel, my notebook clock goes back 18 hours regularly.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
I've tried so many methods so far. Still, I cant read a bitmap image (get the specify information of the bitmap image). Please help me to get over the problem.
Thanks alot!!!
hehe
|
|
|
|
|
What have you tried ?
Dim bm as Bitmap
bm = new Bitmap("c:\myfile.bmp")
bm = Bitmap.FromFile("c:\myfile.bmp)
What else ?
If you want to get at the bitmap bits, VB.NET is kind of useless for that, read my articles on image processing in C#, you're better off writing a C# dll to handle it. You can use GetPixel, but it's slower.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I am converting Word to Html, but I am losing all my footers and headers. Is there any way to retain them?
I am using the MS Word Object 9 library.
I would really appreciate help on this as I have spent ages looking for any answer.
Kind regards,
Polly Anna
|
|
|
|
|
First, this has nothing to do with VB.NET.
Next, you'll have to convert them to sperate HTML SPAN sections yourself. There are no such things as Headers and Footers in HTML.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|