Home | Index | Dotnet4all Snippets | Submit resources
About | Mail us 
How to start and stop a service? (Thursday, October 07, 2004)

Found the following interesting discussion in the Newsgroups:

How can I start and stop the service?
by:Anonymous

Hi EveryBody:

In VB.Net how can I make windows application project that can start and stop the service manually ?

Any help will be appreciated.

Husam



 Reply:
by:Cor Ligthert

 Hi Husam,

Did you already look in the resource kit sample "how to interact with a
window service"?

I hope that helps for you?

Cor

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing it

http://msdn.microsoft.com/vbasic/vbrkit/faq/#installvdir


 Reply:
by:Ken Tucker [MVP]

 Hi,

Add a reference to system.management

Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Service where Name = 'RemoteRegistry'")

moReturn = moSearch.Get
For Each mo In moReturn
Dim args() As Object
Dim strReturn As String = mo.InvokeMethod("StopService",
args).ToString
Trace.WriteLine(String.Format("Stop Service return {0}",
strReturn))
strReturn = mo.InvokeMethod("StartService", args).ToString
Trace.WriteLine(String.Format("Start Service return {0}",
strReturn))
Dim strOut As String
strOut = String.Format("{0} - State {1}", mo("Name").ToString,
mo("State").ToString)
Trace.WriteLine(strOut)
Next
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_service.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/startservice_method_in_class_win32_service.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/stopservice_method_in_class_win32_service.asp

Ken


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
See class 'System.ServiceProcess.ServiceController'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



How to Append text to existing value in TextBox

Found the following interesting discussion in the Newsgroups:

Appending Input to TextBox
by:Richard Grene

I am setting a textbox to a value (ex: ABC). I then setfocus to the textbox
and I want my input to start after the ABC. So if I then enter DEF, my
textbox will show ABCDEF. I need this to occur one character at a time as it
is being entered, not at validating time because I have to examine the
contents of the textbox at each KeyPress Event.

Any help will be appreciated.

Thanks,
Richard


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
Why? What if the user pastes some text from the clipboard to edit it in
the textbox?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 Reply:
by:Cor Ligthert

 Hi Richard,

Probably you need only the last line, however this is nice to see.

I hope it helps?

Cor

\\TextBox1.Text = "ABC"
For i As Integer = 1 To 3
Me.TextBox1.Text += ChrW(67 + i)
Me.Show()
Application.DoEvents()
Threading.Thread.Sleep(1000)
Next
TextBox1.Select(TextBox1.Text.Length, 0)
///




Posted by Xander Zelders
0 Comments



Progress bar in the status bar while waiting

Found the following interesting discussion in the Newsgroups:

Progress bar while waiting
by:Brett Sinclair

Hello everybody
Does anybody knows how to display a progress bar in the status bar while
waiting for a process to finish ?

Any help appreciated.
Thank you


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
<URL:http://www.google.de/groups?selm=OLb56439CHA.2104%40TK2MSFTNGP11.phx.gbl>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



How to change the mouse-cursor

Found the following interesting discussion in the Newsgroups:

change mouse-cursor
by:Maria

Hello !

I try to change the cursor on the form like this :

Me.Cursor = Cursors.WaitCursor
'reading from database
'showing file
Me.Cursor = Cursors.Arrow

But this doesn't change the cursor at all

I have also tried this :

Me.Cursor = New Cursor("wait01.cur")

But nothing happens..

Can anyone help me ?



 Reply:
by:Rob Oldfield

 
Cursor.Current = Cursors.WaitCursor
'blah
Cursor.Current = Cursors.Default


 Reply:
by:Maria

 Thank you - but the cursor didn't change with this code either...


 Reply:
by:Rob Oldfield

 Curious. Grasping at straws here, but you're sure the mouse settings are
correct? Check Mouse pointer settings in Control Panel?


 Reply:
by:Armin Zingler

 
I can't reproduce the problem with Framework 1.1 on WinXP. The cursor
changes as expected.

--
Armin



Posted by Xander Zelders
5 Comments



vb.net compiling and let it run on other machines

Found the following interesting discussion in the Newsgroups:

vb.net compiling
by:Tim Shelton

Anybody familiar with writing programs in VB.net and them trying to install
them on other machines? I get an error that the target machine isn't .net
enabled? How do I get around this? Can I complie VB.net code on any
platform other than .net? I couldn't find that option.


 Reply:
by:CJ Taylor

 Nope.. requires the .Net framework.


 Reply:
by:Brian Henry

 VB has always required a framework, unmannaged C++ is one of the few that
doesn't require one.


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
The .NET Framework must be installed in order to run the application.

Create a setup that includes the .NET Framework:

Using Visual Studio .NET 2003 to Redistribute the .NET Framework
<URL:http://msdn.microsoft.com/library/en-us/dnnetdep/html/vsredistdeploy1_1.asp>

Plug-In:

<URL:http://groups.google.com/groups?selm=z2an4EnoDHA.2012%40cpmsftngxa06.phx.gbl>
<URL:http://workspaces.gotdotnet.com/vsboot/>

Download
<URL:http://www.gotdotnet.com/community/workspaces/newsitem.aspx?id=2f8f0a23-f529-4158-8e0a-d187d16f41f1&newsId=1981>

Framework 1.1:

Redistributing the .NET Framework 1.1
<URL:http://msdn.microsoft.com/library/en-us/dnnetdep/html/redistdeploy1_1.asp>

..NET Framework 1.1 Deployment Guide
<URL:http://msdn.microsoft.com/library/en-us/dnnetdep/html/dotnetframedepguid1_1.asp>

..NET Framework 1.1 Redistributable Prerequisites
<URL:http://msdn.microsoft.com/library/en-us/dnnetdep/html/NETFx1Redistreq1_1.asp>

..NET Framework Redistributable Package 1.1 Technical Reference
<URL:http://msdn.microsoft.com/library/en-us/dnnetdep/html/dotnetfxref1_1.asp>

Framework 1.0:

..NET Framework Deployment Guide
<URL:http://msdn.microsoft.com/library/en-us/dnnetdep/html/dotnetframedepguid.asp>

Using Visual Studio .NET to Redistribute the .NET Framework
<URL:http://msdn.microsoft.com/library/en-us/dnnetdep/html/vsredistdeploy.asp>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 Reply:
by:Cor Ligthert

 Hi Tim,

I had expected an answer from Tom Shelton here, when you are talking about
other platforms he has knowledge of Mono and using that on Linux, however
that is also .Net. as the others stated.

http://www.go-mono.com/class-status-Microsoft.VisualBasic.html

Cor



Posted by Xander Zelders
0 Comments



System.Diagnostics.Process error

Found the following interesting discussion in the Newsgroups:

System.Diagnostics.Process
by:solex

Hello All,

Hopefully someone has run into this error. I have written a class(source
below) that launches a thread to monitor the StandardOutput of a
System.Diagnostics.Process, in particular I am executing the find.exe
program.

The application works perfectly in the development environment. As soon as
I execute the compiled program and start the find process I get an
"Application Error". The error states that the instruction 0x7552bb73
referenced memory at "0x000000000" the memor could not be read.

Has anyone seen this behavior? If so can you point me in the write direction
to a solution?

Thanks,
Dan

Imports System
Imports System.Collections.Specialized
Imports System.Diagnostics
Imports System.IO
Imports System.Threading
Friend Class ProcessController
Private mobjStartInfo As ProcessStartInfo
Private WithEvents mobjProcess As System.Diagnostics.Process
Private mobjErrorMonitor As System.Threading.Thread
Private mobjOutputMonitor As System.Threading.Thread
Public Sub New(ByVal startInfo As ProcessStartInfo)
Me.mobjStartInfo = startInfo
End Sub
Public Sub New(ByVal filename As String, ByVal arguments As String, ByVal
environmentVariables As StringDictionary)
Dim fileInfo As System.IO.FileInfo
fileInfo = New System.IO.FileInfo(filename)
mobjStartInfo = New ProcessStartInfo
mobjStartInfo.FileName = fileInfo.FullName
mobjStartInfo.WorkingDirectory = fileInfo.DirectoryName
mobjStartInfo.Arguments = arguments
If Not (environmentVariables Is Nothing) Then
For Each var As String In environmentVariables.Keys
If (mobjStartInfo.EnvironmentVariables.ContainsKey(var)) Then
mobjStartInfo.EnvironmentVariables(var) = environmentVariables(var)
Else
mobjStartInfo.EnvironmentVariables.Add(var, environmentVariables(var))
End If
Next
End If
mobjStartInfo.RedirectStandardOutput = True
mobjStartInfo.RedirectStandardError = True
mobjStartInfo.RedirectStandardInput = True
mobjStartInfo.UseShellExecute = False
End Sub
Public ReadOnly Property MyProcess() As Process
Get
Return (Me.mobjProcess)
End Get
End Property
Public Function Start() As Process
mobjProcess = System.Diagnostics.Process.Start(mobjStartInfo)
If (mobjProcess.StartInfo.RedirectStandardError) Then
mobjErrorMonitor = New System.Threading.Thread(New
System.Threading.ThreadStart(AddressOf MonitorStandardOutput))
mobjErrorMonitor.Start()
End If
If (mobjProcess.StartInfo.RedirectStandardOutput) Then
mobjOutputMonitor = New System.Threading.Thread(New
System.Threading.ThreadStart(AddressOf MonitorStandardOutput))
mobjOutputMonitor.Start()
End If
Return mobjProcess
End Function
Public Sub [Stop]()
If Not (Me.mobjProcess.HasExited) Then
If (Me.mobjProcess.StartInfo.RedirectStandardInput) Then
Me.mobjProcess.StandardInput.Close()
End If
Me.mobjProcess.Kill()
Me.mobjProcess.WaitForExit()
Me.mobjProcess.Close()
End If
If Not (Me.mobjOutputMonitor Is Nothing) Then Me.mobjOutputMonitor.Abort()
If Not (Me.mobjErrorMonitor Is Nothing) Then Me.mobjErrorMonitor.Abort()
RaiseEvent Stopped()
End Sub
Public Event StandardOutputReadLineHandler(ByVal lineText As String)
Public Event StandardErrorReadLineHandler(ByVal lineText As String)
Public Event Stopped()
Public Event Exited()
Private Sub MonitorStandardOutput()
Try
Dim line As String
line = Me.mobjProcess.StandardOutput.ReadLine()
While Not (line Is Nothing)
RaiseEvent StandardOutputReadLineHandler(line)
line = Me.mobjProcess.StandardOutput.ReadLine()
End While
If (line Is Nothing) Then Me.Stop()
Catch ex As System.Exception
Return
End Try
End Sub
Private Sub MonitorStandardError()
Try
Dim line As String
line = Me.mobjProcess.StandardError.ReadLine()
While Not (line Is Nothing)
RaiseEvent StandardErrorReadLineHandler(line)
line = Me.mobjProcess.StandardError.ReadLine()
End While
Catch ex As System.Exception
Return
End Try
End Sub
Public Sub WriteStandardInput(ByVal text As String)
Me.mobjProcess.StandardInput.Write(text)
End Sub
Public Sub WriteStandardInputLine(ByVal textLine As String)
Me.mobjProcess.StandardInput.WriteLine(textLine)
End Sub
Protected Overrides Sub Finalize()
mobjStartInfo = Nothing
mobjProcess = Nothing
mobjErrorMonitor = Nothing
mobjOutputMonitor = Nothing
MyBase.Finalize()
End Sub
Private Sub mobjProcess_Exited(ByVal sender As Object, ByVal e As
System.EventArgs) Handles mobjProcess.Exited
RaiseEvent Exited()
End Sub


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
Does it work when using this code?

<URL:http://dotnet.mvps.org/dotnet/samples/miscsamples/downloads/RedirectConsole.zip>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



How to define an Application Launch Key

Found the following interesting discussion in the Newsgroups:

Application Launch Key
by:Anonymous

I need to set a key (ex. F1 Key) to launch pword.exe when pressed. I was doing this with a RegisterHotKey command, but this only works when my application is running. I think I need to set a Registry Key instead, as this Key needs to launch pword.exe all the time, not just when my app is running. Does anyone have any examples of setting a Registry Key? I am pretty sure I would use the RegCreateKeyEx function, but I am confused as to what all the parameters are expecting. Any help is appreciated. Thanks.


 Reply:
by:Anonymous

 You don't have to call RegCreateKeyEx, you could call RegCreateKey, it should do what you want to do. I don't know how this function will work in VB.NET. There are .NET classes to edit registry key's so technically RegCreateKey/Ex API is the most complicated way to edit the registry if you're not used to dealing with handles, WIN API, etc.

Mark


 Reply:
by:Anonymous

 What is the difference in RegCreateKeyEx and RegCreateKey? I can't find just RegCreateKey in my documentation. You said there were .Net classes to edit the registry, what are they? I am totally lost. Thanks for your help, sorry to be so ignorant about this, but I haven't worked with the registry before.


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 * "=?Utf-8?B?QVdhdGtpbnM=?=" <anonymous@discussions.microsoft.com> scripsit:
> I am pretty sure I would use the RegCreateKeyEx function, but I am
> confused as to what all the parameters are expecting.

For registry access, have a look at 'Microsoft.Win32.Registry'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 Addendum:

Alternatively, you can create a shortcut file to the application and
assign a shortcut to this file:

<URL:http://vbaccelerator.com/article.asp?id=4301>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



Windows Service keeps process open. How to close it?

Found the following interesting discussion in the Newsgroups:

Windows Service keeps process open.
by:Anonymous

I have a Windows Service that watches a directory using the FileSystemWatcher. When an Excel spreadsheet gets added to that directory, the Windows Service calls a routine that opens the Excel spreadsheet and does some processing (on a seperate thread). After processing is done on the spreadsheet, it is closed and the reference is set to Nothing. However, if you go to the Task Manager, the Excel process is still there. Each time the Service processes a new Excel spreadsheet, a new Excel process is in the Task Manager. Even after stopping the Service, the Excel processes are still in the Task Manager.

How do you get the Excel processes in the Task Manager to go away? Any help is appreciated. Thanks.


 Reply:
by:Anonymous

 If you create a new process from your application, you have to close that process accordingly. The created process of Excel is not going to close by itself, or when the thread the created that process is destroyed. You have to either use the KillProcess API or find some .NET function to do it.
Mark


 Reply:
by:Anonymous

 The code quits the Excel application and sets the reference to Nothing. What else should I need to do? For example:

Dim oXL as Excel.Application
Dim oWB as Excel.WorkBook
'Do some processing stuff
'Before the routine exits, the below is done
oWB = Nothing
oXL.Quit()
oXL = Nothing

I thought that would be enough, but the Excel Processes are still in the Task Manager.


 Reply:
by:Chris Dunaway

 
I notice that the code above does not close the workbook. Is that
necessary?

I'm haven't done much office automation, but have you tried calling the
ReleaseComObject method?

Marshal.ReleaseComObject(oXL)

Just some thoughts
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
Don't do Office automation in a service, that's not recommended:

<URL:http://support.microsoft.com/?kbid=257757>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



How to execute a function from another class in vb.net

Found the following interesting discussion in the Newsgroups:

how to execute a function from another class in vb.net
by:JC via .NET 247

Hi all, I want to execute a function in class 2 from class 1 by clicking a button . Both classes have forms created using design. Anyone can help??

--------------------------------
From: Joseph Cheng


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
You need a reference to the instance to the other form. There is no
general answer to this question, so be more specific to make it easier
to find an appropriate solution.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 Reply:
by:

 u need to create an instance of class 2 in class 1 then
call the instance.functionname on the button click event
ok



Posted by Xander Zelders
0 Comments



Can MDI be motified when child closes

Found the following interesting discussion in the Newsgroups:

Can MDI be motified when child closes
by: SamSpade

I need a MDI form to be notified when one of it's child closes.

I could define an event in each child and raise it when it closes.

But if there is some WinProc message that occurs when a child closes I would
rather use it and automate the process.
Second question. When a form Closed event occurs is the form then disposed.
I want to check the variable that references the form and if the form is
closed do a 'New"
So I'll check to see if it's disposed - right?

thanks


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 

\\Private m_Child As Form2

Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles Button1.Click
If m_Child Is Nothing Then
m_Child = New Form2()
m_Child .MdiParent = Me
AddHandler m_Child.Load, AddressOf Me.MdiChild_Load
AddHandler m_Child.Closed, AddressOf Me.MdiChild_Closed
End If
m_Child.Show() ' ...
End Sub

Private Sub MdiChild_Load( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
)
MsgBox( _
"MdiChild with handle " & _
DirectCast(sender, Form).Handle.ToString() & _
" loaded!" _
)
End Sub

Private Sub MdiChild_Closed( _
ByVal sender As Object, _
ByVal e As System.EventArgs _
)
MsgBox( _
"MdiChild with handle " & _
DirectCast(sender, Form).Handle.ToString() & _
" closed!" _
)
End Sub
///


> Second question. When a form Closed event occurs is the form then disposed.
> I want to check the variable that references the form and if the form is
> closed do a 'New"
> So I'll check to see if it's disposed - right?

\\If <...>.IsDisposed Then
...
End If
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



MDI Child Window Closing event not raised

Found the following interesting discussion in the Newsgroups:

MDI Child Window Closing event not raised
by:grimsbyarchers@lycos.com (chris in grimsby)

MDIChild Window Closing event not raised when MDI Parent is in a class
library!

Intructions to recreate problem:
1. Create a ClassLibrary project
2. Add an MDIParent form and a form that will be an MDIChild form
3. In the Closing event of both forms add debug code so that you can
see when they are called


<MDI PARENT FORM CODE>
Private Sub MDIParent_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Debug.WriteLine("MDIParent_Closing " & Now & " " &
e.Cancel.ToString)
End Sub

Private Sub MDIParent_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim f As New MDIChild
f.MdiParent = Me
f.Show()
End Sub

<MDI CHILD FORM CODE>
Private Sub MDIChild_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Debug.WriteLine("MDIChild_Closing " & Now & " " &
e.Cancel.ToString)
End Sub

4. Add a Windows Application to act as the client and set the
reference:

<MODULE1 CODE>
Sub Main()
Dim f As New ClassLibrary1.MDIParent
f.ShowDialog()
End Sub

5. Run the application. Click the X close button on the MDIParent and
you will see that the MDIParent_Closing event fires but not the
MDIChild!

If you put the MDIParent and MDIChild in a Windows application, it all
works ok!


 Reply:
by:Armin Zingler

 
replace
f.ShowDialog()
by
application.run(f)

An Mdi Form is not a dialog. Dialogs behave differntly.
--
Armin


 Reply:
by:Armin Zingler

 

> If you put the MDIParent and MDIChild in a Windows application, it
> all works ok!

Here there's no difference. As long as you use showdialog, the closing event
of the child does not fire, no matter where the forms are.
--
Armin




Posted by Xander Zelders
0 Comments



A Password for a from

Found the following interesting discussion in the Newsgroups:

Form Password
by:MadCrazyNewbie

Hey Group,

I would like to Password a form but i would like to have some sort of maths
function to work out the password, nothing to difficult, but something like,
Date + 10 so for example todays date = 23 + 10 = so the password would be
33?

Is this easy to do?

Any links or help would be greatly appriciated

Many Thanks
Si


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
Should the password /change/ whenever the application is started? For
your simple calculation, have a look at the properties of the 'DateTime'
datatype. You can use 'DateTime.Now' to get the current date and then
do the calculations with its property values.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



How to print from PictureBox and Managed DirectX9.0

Found the following interesting discussion in the Newsgroups:

printing from PictureBox and Managed DirectX9.0
by:castilla1712@hotmail.com (Antonio Orozco)

Ok, i already have my directx image on a picture box, but now i want
to print it and i don't find how to do this... can somebody help me?
thnks....

Antonio O.


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
How did you put the image onto the picturebox? Is the image a 'Bitmap'
object?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 Reply:
by:Armin Zingler

 
To find out how to capture the image, I'd ask in the MDX group
(microsoft.public.win32.programmer.directx.managed). If you've got the
surface reference, you can call it's GetDC method and blit the image to a
Bitmap object.

How to print it:
http://msdn.microsoft.com/library/en-us/vbcon/html/vbconPrintSupport.asp
--
Armin


 Reply:
by:castilla1712@hotmail.com (Antonio Orozco)

 >If you've got the surface reference, you can call it's GetDC method
and blit the image to a Bitmap object.


how can i do this???? the surface reference??? the getdc method???
blit the image???? explain me please..... thnx
antonio o.


 Reply:
by:Armin Zingler

 
Ok, seems the managed DX group is the right place to ask this:

microsoft.public.win32.programmer.directx.managed
--
Armin



Posted by Xander Zelders
0 Comments



How to build an EXE

Found the following interesting discussion in the Newsgroups:

Build EXE
by:Anonymous

I know this is a very elementary question but here goes:

Inside Visual Studio, how do you create an EXE once you have all your forms made and working the way you want?


 Reply:
by:Robin Tucker

 There isn't a seperate "build exe" in .NET as there was in VB 6. Whenever
you build, your assembly and .exe are constructed. You should find it in
the BIN directory of your project on disk.


 Reply:
by:Anonymous

 Thanks alot Robin. That is what I was looking for.


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
Have a look at the "Build" menu. In VB 2005 a make command in the "File"
menu will be reintroduced.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



SelectedIndexChanged event and the list view control.

Found the following interesting discussion in the Newsgroups:

SelectedIndexChanged event and the list view control.
by:Robin Tucker

When volume testing my application I have noticed a big problem with
listview controls populated with large numbers of items (ok, when I say
large, I mean 3 or 4 hundred items, so in the grand scheme of things, quick
small!).

The problem is that I am using a multiple selection list view and if the
user selects item 1 and then Shift-selects to the end of the list, the
selectedindex event is fired around 400 times! This means that any events I
fire or things I do in the handler get executed once for each new selected
item.

What I want to do is detect a selection change in the round, not on an
individual item basis, so I can fire my event just once when a new "multiple
selection" is made.

How can I do this?


 Reply:
by:EricJ

 i know this is a bit strange but i don't c another option right now (not
tested but the idea should work)

i don't think you can pass the selectedindex(changed)
but you can do a control in there and don't execute your code if you don't
need to

on the keydown of the listbox check the shift
if it is shift set a boolean to false
in your selectedindexchanged only do your code if the boolean is true
on the keyup test again for shift and set the boolean back to true

keep in mind if you manually fill large listboxes and combos set the sorted
to false before you start filling and back to true when you are done. (if
you sort every time as you are adding +5k items it gets slow 2)

hope it helps a bit

eric


 Reply:
by:Robin Tucker

 Thanks, but I got it via a different route - similar concept though ;)


 Reply:
by:EricJ

 :)
as long as it is working


 Reply:
by:Robin Tucker

 Ok, I solved my own problem. What I did was setup a flag called
"m_bSelectionChanged", set to false by default. In the SelectionChanged
event for the listview, I just have "m_bSelectionChanged = true". Now I
also handle the MouseUp event and in the MouseUp event I write "if
m_bSelectionChanged then ...... m_bSelectionChanged = false.... end if" and
voilla, it works no more drag :)



Posted by Xander Zelders
0 Comments



Error with SHA1 Encryption

Found the following interesting discussion in the Newsgroups:

Please Help - Encryption Problems
by:Jamie Sutherland

Hi,
I have a problem in that I have 2 applications writing to the same Database.
One App is web based and the other is windows/forms based.
Both have the same job in that they can reset a users password in the
database. Both are using SHA1 encryption however they both ghive different
results when the programs are run.
If I run the windows exe file and set the password to password the exe
encrypts as follows: 5BAA61E4C9B93F3F68225B6CF8331B7EE68FD8

If I run the web based version with the word password I get the following:
5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8

Notice the web version has extra in it.
Please help..... Below is the code I have been using for both versions:

Web Version:
Dim PwdAs String = "password"
Dim hashedPwd As String =
FormsAuthentication.HashPasswordForStoringInConfigFile(Pwd, "SHA1")
Return hashedPwd
Windows Exe Version:
Dim PwdAs String = Trim("password")
Dim Data As Byte()
Data = System.Text.Encoding.ASCII.GetBytes(Pwd)
Dim shaM As New SHA1Managed
Dim resultHash As Byte() = shaM.ComputeHash(Data)
Dim hashedpwd = ""
Dim b As Byte
For Each b In resultHash
hashedpwd += Hex(b)
Next
Return hashedpwd
Thanks
Jamie


 Reply:
by:Joe Kaplan \(MVP - ADSI\)

 It is probably an encoding problem. Forms auth uses UTF8 encoding and you
are using ASCII. I suggest you try switching to UTF8 first.

Joe K.


 Reply:
by:Hernan de Lahitte

 I agree with Joe suggestion.
FormsAuthentication.HashPasswordForStoringInConfigFile method actually
encode in UTF8 and not in ASCII as you do in the WinForms scenario. BTW, I
suggest to use the same methods for both clients
(HashPasswordForStoringInConfigFile should be well suited in this case).
However, if you are hashing passwords for storing in a DB, I recommend you
to add a salt value for dictionary attacks mitigation. Check out this code
from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch12.asp:

Creating a Salt Value
The following code shows how to generate a salt value by using random number
generation functionality provided by the RNGCryptoServiceProvider class
within the System.Security.Cryptography namespace.


public static string CreateSalt(int size)
{
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
byte[] buff = new byte[size];
rng.GetBytes(buff);
return Convert.ToBase64String(buff);
}Creating a Hash Value (with Salt)

The following code fragment shows how to generate a hash value from a
supplied password and salt value.

public static string CreatePasswordHash(string pwd, string salt)
{
string saltAndPwd = string.Concat(pwd, salt);
string hashedPwd =
FormsAuthentication.HashPasswordForStoringInConfigFile(
saltAndPwd, "SHA1");
return hashedPwd;
}

--
Hernan de Lahitte
Lagash Systems S.A.


 Reply:
by:Joe Kaplan \(MVP - ADSI\)

 I also agree with Hernan in that adding random salt is very important to
prevent dictionary attacks. There have been some excellent articles written
on this topic recently.

Joe K.


 Reply:
by:Jamie Sutherland

 Thanks Guys,
You have been so much help. FYI. I am using salt but i though to remove the
code save space etc....Have any of you people had any experiance of writting
a VLE (virtual Learning Enviroment) (teaching Online) if so what could thing
could you recommend?

Again Many Thanks, I will try on Monday.
Jamie



Posted by Xander Zelders
3 Comments



How to use StreamReader.Peek()

Found the following interesting discussion in the Newsgroups:

Using StreamReader.Peek()
by:Shawn

Hi. I'm using this code to loop through all the lines in a text field:
While myStreamReader.Peek() > -1
myStreamReader.ReadLine()
i = i + 1
End While

Now, what I need to do is to loop through all the lines one more time and do
the work that I'm supposed to do. The reason for this is that I have to
know how many lines exists in the text file in order to display a
ProgressBar to the user. I've tried setting
myStreamReader.BaseStream.Seek(0, SeekOrigin.Begin) but
myStreamReader.Peek() just returns -1.

Is it not possible to achieve this without having to close the FileStream
and create a new one?

Thanks,
Shawn


 Reply:
by:Mattias Sjögren

 
Do you have to use Peek()? I'd do it like this

While Not myStreamReader.ReadLine() Is Nothing
i = i + 1
End While

I don't know it that's any more Seek friendly though.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com


 Reply:
by:Chris Dunaway

 
myStreamReader.BaseStream.Position = 0

I don't know if that will work in this situation though.

Are the lines in the file all the same length? If so, you can get the
number of lines by dividing the length of the file by the line size.

Another method for handling a progress bar is to set the progress bar with
a max value of 100. Then each time you read a line, take the length of the
line and divide it by the length of the file and multiply by 100. Then
increment the progress bar's value by that amount. That way you don't have
to read through every line in the file beforehand:

'This is untested code
myProgressBar.Value = 0
While myStreamReader.Peek <> -1
strLine = myStreamReader.ReadLine()
intPercent = (strLine.Length / myStreamReader.BaseStream.Length) * 100

'Do something with strLine here

'Update the progress bar
myProgressBar.Value += intPercent
End While

Hope this helps a little

--
Chris



Posted by Xander Zelders
0 Comments



How to use StreamReader.Peek()

Found the following interesting discussion in the Newsgroups:

Using StreamReader.Peek()
by:Shawn

Hi. I'm using this code to loop through all the lines in a text field:
While myStreamReader.Peek() > -1
myStreamReader.ReadLine()
i = i + 1
End While

Now, what I need to do is to loop through all the lines one more time and do
the work that I'm supposed to do. The reason for this is that I have to
know how many lines exists in the text file in order to display a
ProgressBar to the user. I've tried setting
myStreamReader.BaseStream.Seek(0, SeekOrigin.Begin) but
myStreamReader.Peek() just returns -1.

Is it not possible to achieve this without having to close the FileStream
and create a new one?

Thanks,
Shawn


 Reply:
by:Mattias Sjögren

 
Do you have to use Peek()? I'd do it like this

While Not myStreamReader.ReadLine() Is Nothing
i = i + 1
End While

I don't know it that's any more Seek friendly though.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com


 Reply:
by:Chris Dunaway

 
myStreamReader.BaseStream.Position = 0

I don't know if that will work in this situation though.

Are the lines in the file all the same length? If so, you can get the
number of lines by dividing the length of the file by the line size.

Another method for handling a progress bar is to set the progress bar with
a max value of 100. Then each time you read a line, take the length of the
line and divide it by the length of the file and multiply by 100. Then
increment the progress bar's value by that amount. That way you don't have
to read through every line in the file beforehand:

'This is untested code
myProgressBar.Value = 0
While myStreamReader.Peek <> -1
strLine = myStreamReader.ReadLine()
intPercent = (strLine.Length / myStreamReader.BaseStream.Length) * 100

'Do something with strLine here

'Update the progress bar
myProgressBar.Value += intPercent
End While

Hope this helps a little

--
Chris



Posted by Xander Zelders
0 Comments



How to load an unmanaged dll dynamically

Found the following interesting discussion in the Newsgroups:

dynamically loading unmanaged dll
by:maciek/P

Hi,

How to load dynamically (dllpath) function from old (unmanaged) dll
library in vb.net. This function has several parameters and I can't use
LoadLibrary/GetProcAddress/CreateThread method. Is any API function
which call function by its handle (pointer)?
thanx


 Reply:
by:Mattias Sjögren

 
Do you know the name of the DLL? If so, you can just call LoadLibrary
with the full path to get it loaded, then a regular Declare statement
should work.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com



Posted by Xander Zelders
0 Comments



How to Load a image from file

Found the following interesting discussion in the Newsgroups:

Loading image from file
by:Simon Jefferies

Hello,

I am trying to load an image from a file and put the image into a picturebox
with the following code:

Dim ImgThumbnail As System.Drawing.Image =
picImage.Image.FromFile(Filename).GetThumbnailImage(picImage.Width,
picImage.Height, Nothing, Nothing)
picImage.Image = ImgThumbnail.Clone
ImgThumbnail.Dispose()

The problem I am having is that it locks the file. Is there anyway to
release the lock on the file?

Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:simonj@headfirst.co.uk
www.headfirst.co.uk www.callofcthulhu.com
-


 Reply:
by:Sven Groot

 
Dim Img as System.Drawing.Image = System.Drawing.Image.FromFIle(Filename)
Dim ImgThumbnail As Image = Img.GetTumbnailImage() ' parameters omitted
Img.Dispose()

--
Sven Groot


 Reply:
by:Simon Jefferies

 All sorted, thanks!

Best Wishes
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:simonj@headfirst.co.uk
www.headfirst.co.uk www.callofcthulhu.com



Posted by Xander Zelders
0 Comments



How to redirect to a page when the session ends.

Found the following interesting discussion in the Newsgroups:

Global.asax
by:ruca

Hi,
How can I Redirect my web application to a page when a session ends? (I've
set a timeout)

I have this in my Global.asax in Session_End Event:
Context.Response.Redirect("login.aspx")

but it doesn't work
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca


 Reply:
by:Philip Q [MVP]

 
The Session_End event is meant for clearing up any objects or items that
you have created for the session, you cannot interactively do anything
with the user.

When a session closes, it is usually because of a timeout because the
user has not requested anything from the server and the connection has
been lost (eg. the user has closed the browser).

The Session_End event is not triggered by the user, so you cannot do
anything with it.

You can only redirect the user when the next session starts again.

--
Philip Q
Microsoft MVP [ASP.NET]


 Reply:
by:Hans Kesting

 
When the session ends, there is no request to respond to (there has been
no request for the past 20 minutes, so the browser may have been closed
or even the internet connection to that browser is off)

What you probably want to do is, if the browser has displayed the last
screen for too long, redirect to a login page.
This is impossible from the server side, but possible from client side:
use <meta http-equiv=refresh> to redirect after the session should have
been expired.
Note: this may start a new session!

Hans Kesting


 Reply:
by:Patrice

 This event doesn't arise when there is currently a http request. You can't
do that.

Instead Session.IsNewSession allows to know the user starts a new session.
What's happening for now (it could perhaps depend also on the authorization
scheme currently in use ?)

Patrice



Posted by Xander Zelders
0 Comments



How to access frameproperties in vb.net?

Found the following interesting discussion in the Newsgroups:

How do I access frameproperties in vb.net?
by:Bengt-Erik Eliasson

Hello!
In my mainpage i have two frames (MENU and MAIN). In the MAIN I load another
page with frames (Sub_Frame.htm). It contains TOP and BOTTOM frame. In
BOTTOM frame I have a page with a button (Result.aspx). What I want to do is
from that button, change the SRC in a frameset two levels up (SRC for MAIN
frame in Main_Frame.aspx should be changed from Sub_Frame.aspx to
http://www.gotdotnet.com). How do I achieve this?

Best regards
/ Bengt-Erik

Main_Frame.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>Contents Frameset</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</head>
<frameset cols="150,*">
<frame name="menu" src="Menu.aspx">
<frame name="main" src="Sub_Frame.htm">
<noframes>
<p id="p1">
This HTML frameset displays multiple Web pages. To view this frameset,
use a
Web browser that supports HTML 4.0 and later.
</p>
</noframes>
</frameset>
</html>

Sub_Frame.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>Horizontal Split Frameset</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</head>
<frameset rows="*,*">
<frame name="top" src="Search.aspx">
<frame name="bottom" src="Result.aspx">
<noframes>
<p id="p1">
This HTML frameset displays multiple Web pages. To view this frameset,
use a
Web browser that supports HTML 4.0 and later.
</p>
</noframes>
</frameset>
</html>

Result.aspx:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Result.aspx.vb"
Inherits="localhost.Result"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Result</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:TextBox id="txtUrlToOpen"
runat="server">http://www.gotdotnet.com/</asp:TextBox></P>
<P>
<asp:Button id="btnOpenUrl" runat="server" Text="Open URL in main
window"></asp:Button></P>
</form>
</body>
</HTML>

Result.aspx.vb:
Public Class Result
Inherits System.Web.UI.Page
Protected WithEvents txtUrlToOpen As System.Web.UI.WebControls.TextBox
Protected WithEvents btnOpenUrl As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub btnOpenUrl_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOpenUrl.Click
'Here is the thing I wan't to achieve...
'Parent.Parent.Frames("main").Src = txtUrlToOpen.Text
End Sub
End Class


 Reply:
by:Cor Ligthert

 Hi Bengt,

This is not a standard feature from aspx.
(This version from Net is frameless with aspx pages, of course you can do it
with HTML).

However I have seen answers on this questions to simulate it in the
newsgroup

microsoft.public.dotnet.aspnet

Maybe you can search it or ask it there also.

I hope you find your solution.

Cor



Posted by Xander Zelders
0 Comments



Datagrid scrolling onCurrentCellChanged

Found the following interesting discussion in the Newsgroups:

Datagrid scrolling onCurrentCellChanged
by:John Bayly via .NET 247

I'm working on an inherited Datagrid class that includes a function called onMouseMove to paint the row under the cursor to make reading easier for users.
To paint the row, the function sets the current cell to by:

'Get Screen Coorinate of Mouse Cursor
Dim p As Point = New Point(dgrid.Parent.MousePosition.X, _
dgrid.Parent.MousePosition.Y)
'Convert Screen Coordinates to Local Coordinates
Dim pC As Point = dgrid.PointToClient(p)

'Runs Hit Test on Datagrid
Dim ht As DataGrid.HitTestInfo = dgrid.HitTest(pC)

'Check if Mouse is over Cell
If ht.Type = DataGrid.HitTestType.Cell Then
'Get current row and column
Dim r As Integer = ht.Row
Dim c As Integer = ht.Column

'Set Current Cell to Cell under mouse cursor
dgrid.CurrentCell = New DataGridCell(r, c)

'Gets Information for passing to paint method
Dim ds As DataGridTableStyle = dgrid.TableStyles(0)
Dim d As DataGridEnableTextBoxColumn
Dim curr As CurrencyManager
Dim g As Graphics = dgrid.CreateGraphics
Dim rect As Rectangle
Dim fBrush As SolidBrush = New _
SolidBrush(Color.Gold)
Dim bBrush As SolidBrush = New _
SolidBrush(Color.FromArgb(51, 51, 51))
curr = CType(dgrid.Parent.BindingContext(dgrid.DataSource), _
CurrencyManager)
'Loops through all columns
Dim i As Integer
For i = 0 To dgrid.VisibleColumnCount - 1
d = CType(ds.GridColumnStyles(i), _
DataGridEnableTextBoxColumn)
If d.Width > 0 Then
rect = dgrid.GetCellBounds(r, i)
d.PaintCol(g, rect, curr, r, bBrush, fBrush, False)
End If
Next
End If

DataGridEnableTextBoxColumn is a class inherited from DataGridTextBoxColumn

The problem I am having is that when the user moves the mouse over the last visible row in the datagrid (example row=7), it calls the function, and when the currentcell is changed, it will automatically scroll down by 1 row. The mouse cursor still remains in the original positions (now over row=8). If the mouse is moved again, it will scroll down another row. What I need to do is stop the datagrid from scrolling automatically when the last currentcell is set to the last visible row.

Does anybody have any idea how to stop this, my users are getting seriously sick of uncontrolled scrolling when trying to view data

--------------------------------
From: John Bayly


 Reply:
by:Jens Blom

 Hi
Try this


Private Sub DataGrid1_ItemCreated(ByVal sender _
As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) _
Handles DataGrid1.ItemCreated
Dim foo As Web.UI.WebControls.DataGridItem = e.Item
foo.Attributes.Add("onmouseover", "bgColor='#345622'")
foo.Attributes.Add("onmouseout", "bgColor=''")
End Sub


Let me know if its was what ur looking 4
/Jens



Posted by Xander Zelders
0 Comments



Getting Syntax error converting from a character string to uniqueidentifier

Found the following interesting discussion in the Newsgroups:

Getting Syntax error converting from a character string to uniqueidentifier
by:Roy Rodsson via .NET 247

Hi all!

I am using a stored procedure in SQL2000 for retrieving file informations from a db.
the table as an uniqueidentifier for the file information.

The stored procedure has a variable called fileIds that is of type varchar.
I am putting in a comma separated string with ids (such as: '9B176B0C-CA03-49C9-A2E7-063038E7CF20','9B176B0C-CA03-49C9-A2E7-063038E7CF22','9B176B0C-CA03-49C9-A2E7-063038E7CF23')

However, when I execute the sp via my dataadapter.fill I get the mentioned "Syntax error converting from a character string to uniqueidentifier" back.
To me it seems like the IN part doesn't like the comma separated string with unique ids :-(

select
*
FROM
Files
WHERE
Files.FileID IN(@FileIds);
The strange stuff is that the sp works correctly when I execute it from the query analyzer !

By the way - I am using a typed dataset in the fill command, but I have verified the results several of times and it seems to be correct (for instance, I have let the dataadapter create a new dataset and compared it with my typed dataset - they are identical) I have also tried to select everything without the where part and it works fine - so I guess the problem is in the "IN (@FileIds)" - part ?
Please, help me to shed a light on this problem.

/Roy.
--------------------------------
From: Roy Rodsson


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
You will more likely get an answer here:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 Reply:
by:EricJ

 the problem is that when your sp gets the string is adds its own ' '
you would get
select
*
FROM
Files
WHERE
Files.FileID
IN(''9B176B0C-CA03-49C9-A2E7-063038E7CF20','9B176B0C-CA03-49C9-A2E7-063038E7
CF22'');
1 whole string instaid of comma separated

I don't know a sollution to do this in an sp but i would execute it as
sqltext directly from vb. You don't put user input directly in the statement
and precompiled sp is useless since the condition always changes)
yust a thought

eric



Posted by Xander Zelders
0 Comments



Printing formats

Found the following interesting discussion in the Newsgroups:

Printing proprietary formats
by:Dan

We are running into trouble when trying to print
proprietary formats (ie; .pdf, .xls, .doc, etc.) from our
VB.NET application.

Binary files generate garbage when printed.

We have no trouble printing text files using .NET objects
such as System.Drawing.Printing.PrintDocument and would
like to do the same thing with binary files without having
to go through multiple APIs.

Does anyone have any suggestions or ideas about this?

Thanks in advance for any assistance.


 Reply:
by:Anonymous

 Text files are a known format. All the file formats you mentioned have application-specific information embedded with the actual data, so you can't just tell them to print like a text document and expect to get any kind of intelligible output.

You either have to use the application's libraries to print with (like starting an instance of Word, loading your .doc file and printing it. This would require Word to be installed on the machine running the app), become familiar with the file format to the point where you can reliably pull the data you want out of it, or purchase or otherwise aquire third party software that allows you to print these formats.

That sort of goes along with the concept of a proprietary file format. This is exactly the reason XML is so popular today. It gets rid of all these sorts of problems, at the expense of file size and speed, among other things.


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 * "Dan"
That's not possible.

You can start the associated application with the print verb:

\\Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.htm"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



Posted by Xander Zelders
0 Comments



How to use InsertCommand and UpdateCommand

Found the following interesting discussion in the Newsgroups:

about insertCommand and updateCommand for Employees
by:rEdMiddLe

I use insertCommand insert a record into Employees and use updateCommand
update the record at now.but happend exception
because the employid's column of employess is identity.so can you help me?


 Reply:
by:Cor Ligthert

 Hi R.....

Show a little piece of your code.
However better is to ask this in the newsgroup (with that code)

Adonet
<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<http://communities2.microsoft.com/communities/newsgroups/en-us/?dg=microsof
t.public.dotnet.framework.adonet>
I hope this helps a little bit?

Cor



Posted by Xander Zelders
0 Comments



What is TimerControl?
What is a TimerControl?

The Timer control is used to set a time interval to execute an event after that interval continuously. It is useful when you want to execute certain applications after a certain interval.

This interval can be set using the TimerInterval Property. When this property is set to 5000, this means an interval of 5 seconds. When the control is named Timer1 and in design-time? the TimerControl is clicked, the Timer1_Elapsed function can be implemented. This function (or actually event) will execute every time the Timer Interval has elapsed.

Posted by Xander Zelders
0 Comments



What is an Event?
What is an event?

An event is the occurrence of anything of interest in the context of your program. For example, a program used for Email might consider an event to have happened when an email arrives. At that point, the program springs into action to show a message 'You've got mail!'.

Events are often very important parts of a Class.

Read more about Classes, Objects, Methods, Properties

Posted by Xander Zelders
0 Comments



Exact: Windows 95, MS Word, MS Excel, MS Access, My Net Nw Powerpoint


Exact: Windows 95, MS Word, MS Excel, MS Access, My Net Nw Powerpoint
by Martin


Paperback
Publisher: Harcourt College Pub; Book&Disk edition (August 1, 1997)
ASIN: 0155680625

Posted by Xander Zelders
0 Comments



Concepts: Windows 95, MS Word 97, MS Excel 97, Access 97


Concepts: Windows 95, MS Word 97, MS Excel 97, Access 97
by Martin

Hardcover
Publisher: Harcourt College Pub; Book&Disk edition (June 1, 1998)
ASIN: 0155679481

Posted by Xander Zelders
0 Comments



Sm Exploring Ms Access 7.0 Win


Sm Exploring Ms Access 7.0 Win
by Grauer


Paperback
Publisher: Prentice Hall (Higher Education Division, Pearson Education); (March 4, 1998)
ISBN: 0135064031


Posted by Xander Zelders
0 Comments



INFO TECH IN BUSINESS MS ACCESS 2.0 PACK


INFO TECH IN BUSINESS MS ACCESS 2.0 PACK
by SENN


Hardcover
Publisher: Pearson Higher Education; (February 2, 1995)
ISBN: 0134850041


Posted by Xander Zelders
0 Comments



Understanding MS Access - MS Access Instant Reference


Understanding MS Access - MS Access Instant Reference
by Alan Simpson


Paperback: ; Dimensions (in inches): 9.09 x 2.46 x 7.58
Publisher: Sybex Inc; (June 1, 1993)
ASIN: 0782112730

Posted by Xander Zelders
0 Comments



Sm Exploring Ms Access 7.0 Win


Sm Exploring Ms Access 7.0 Win
by Grauer


Paperback
Publisher: Prentice Hall (Higher Education Division, Pearson Education); (March 4, 1998)
ISBN: 0135064031

Posted by Xander Zelders
0 Comments



Overrun Edition: O/R Ms Access 2000 Brief


Overrun Edition: O/R Ms Access 2000 Brief
by O'leary


Paperback
Publisher: McGraw-Hill Education - Europe; (February 1, 2001)
ASIN: 0071179461


Posted by Xander Zelders
0 Comments



Ms Access 7.0 Windows 95


Ms Access 7.0 Windows 95
by O'leary


Unknown Binding
Publisher: McGraw-Hill Education - Europe; (August 1, 1996)
ASIN: 0071145451


Posted by Xander Zelders
0 Comments



Overrun Edition: O/R Ms Access 7 Wind Iasce


Overrun Edition: O/R Ms Access 7 Wind Iasce
by Hutchinson


Unknown Binding
Publisher: McGraw-Hill Education - Europe; (June 1, 1996)
ASIN: 007114367X


Posted by Xander Zelders
0 Comments



INFO TECH IN BUSINESS MS ACCESS WIN PACK


INFO TECH IN BUSINESS MS ACCESS WIN PACK
by SENN


Hardcover
Publisher: Pearson Higher Education; (February 2, 1995)
ISBN: 013484940X


Posted by Xander Zelders
0 Comments



Access 2000 und MS SQL Server im Teamwork.