|
|
I am not using crystal report available with .net.I am Using Crystal Reports OCX Control
The code which I use is,
This is the two sentences which makes problem.
axCrystalReport1.ReportFileName= Application.StartupPath.ToString() + \\Reports\\Sample.rpt;
axCrystalReport1.Connect=System.Configuration.ConfigurationSettings.AppSettings
Here I use a dsn to connect which I want to avoid.
If I bring the result in a dataset I dont see any method to assign it to the report Object.This could have been done effectively with crystal reports of vs.net
|
|
|
|
|
|
Hi all,
I'm looking for people's thoughts on a problem I'm having. We mark users as active if they log in to our app, so they can't log into the app again using the same user. If they crash their PC they are left as active and can't log back into the sytem. How can find out if a user crashed out instead of being still logged in? I know this is probably a basic programming problem, but i've struggled for a solution so far.
Any help would be much appreciated.
|
|
|
|
|
Two solutions:
You could time out the login. If there has been no activity against their account after a period of time the system automatically logs them out.
You could set up a sort of heart beat where by the client PC sends a heartbeat message to the server every few seconds. If the server has no heartbeat after, say, a minute then it logs the user out automatically. This solution is really the same as the first one but with a shorter timeout because the PC is automatically generating events on a frequent basis. However, this could clog the network with heartbeat messages if you have a lot of clients.
Scottish Developers upcoming sessions include:
.NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
My: Website | Blog
|
|
|
|
|
Hi Colin,
Thanks for those solutions. I actually want users who crash out to be able to log in again. I suppose what I could do is everytime a client logs in, the server adds it to its list and marks it active. It then sends it your idea of a heartbeat every few seconds. If the user crashes their machine the heartbeat isn't answered so they get taken off the list and marked as inactive.
This could be the solution but seems like overkill.
Thanks for your help.
|
|
|
|
|
Not sure what is overkill about it. I have done it and it solves the issue pretty well.
It's really the only way to be 100% sure the client is still there. You don't want to just ping the machine either because that is no indication that the client app is still alive. Maybe just the app dies (or its task was ended with task manager) so you have to do some kind of message exchange with the app itself.
My Blog[^] FFRF[^]
|
|
|
|
|
Hi Ray,
Thanks for your help. What kind of message exchange did you use / recommend?
|
|
|
|
|
The exchange message contents really don't matter. Just the fact that you can send a message and get a response may be enough for you.
My application had specific requirements centered around security so when my users logged in they got back a security token. The server process would periodically ping them by sending a simple text string of 'TokenRequest' and the client had to respond with a hashed version of the token back. The server then compared the hashed response to the token that was stored form when they logged on and if they were the same then the client was still connected. If they were different then the client was disconnected by the server.
Unless you need all that security though you might be better off with just a ping pong type message. Something fast and simple.
My Blog[^] FFRF[^]
|
|
|
|
|
Sir,
I am using the following code to print the window page in vb.net 1.1.But getting th error
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.drawing.dll
The data area passed to the system call is too small.
Private Declare Function BitBlt Lib "gdi32.dll" Alias "BitBlt" (ByVal _<br />
hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As _<br />
Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal _<br />
hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, _<br />
ByVal dwRop As System.Int32) As Long<br />
Dim memoryImage As Bitmap<br />
Private Sub CaptureScreen()<br />
Dim mygraphics As Graphics = Me.CreateGraphics()<br />
Dim s As Size = Me.Size<br />
memoryImage = New Bitmap(s.Width, s.Height, mygraphics)<br />
Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage)<br />
Dim dc1 As IntPtr = mygraphics.GetHdc<br />
Dim dc2 As IntPtr = memoryGraphics.GetHdc<br />
BitBlt(dc2, 0, 0, Me.ClientRectangle.Width, _<br />
Me.ClientRectangle.Height, dc1, 0, 0, 13369376)<br />
mygraphics.ReleaseHdc(dc1)<br />
memoryGraphics.ReleaseHdc(dc2)<br />
End Sub<br />
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage<br />
e.Graphics.DrawImage(memoryImage, 0, 0)<br />
End Sub<br />
Private Sub PrintButton_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintButton.Click<br />
CaptureScreen()<br />
PrintDocument1.Print()<br />
End Sub
Please help me.
Thanks and Regards
Amaneet Brar
-- modified at 7:03 Monday 12th June, 2006
|
|
|
|
|
hai
as i m new to vb.net
anyone plz tell me the concept of licensing in vb.net
can anyone plz send me the code of licensing in vb.net.
how i can issue a license of 30 days for my application.
its very very urgent
thank you
|
|
|
|
|
One option would be to store the date the application was installed/should expire in the registry either during installation or the first time the user runs the app. Then insert code to check that registry value. In Visual Studio 2005 you can do this check in the ApplicationEvents.vb MyApplication_Startup Event. Like this:
Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
'If the current date is greater than or equal to the Expiration date, then the program will not open.
If CInt(Now.Date.ToString("yyyyMMdd")) >= gblintExpireDate Then
MessageBox.Show(My.Application.Info.ProductName & " has expired.", My.Application.Info.ProductName)
e.Cancel = True
End If
End Sub (Of course the gblintExpireDate would have to be a value from the registry instead of a global constant like I use)
Or for other versions of Visual Studio I suppose you can do this check in the OnLoad of the first form or in your main sub...
Hope this helps.
|
|
|
|
|
You could (instead of licensing) write the date when the program was installed to a key in the registry, and if the program is started when more than 30 days have gone by, the program won't start.
----
Dim Sleepy as Boolean = True
If Me.Sleepy = True Then
Goto Sleep
End If
----
|
|
|
|
|
HOw can i connect from vb.net 2005 to Excel, Foxpro?
................
|
|
|
|
|
|
I'm using an access database with VB6. My program has been working well until now. Then I set password on mdb database, the program not connect the database. Does anybody have any suggest how I can repair it, view or extract the data. Can anybody suggest why this is happening.
Thanks!
Tran Dung
|
|
|
|
|
Did you use access workgroup? If you use it you should change your provider
................
|
|
|
|
|
|
Guys in Web Application we use the Session object to follow user activity. What is it that is used in Windows Forms Application?
manv
|
|
|
|
|
What is you question?
................
|
|
|
|
|
My question is, what object is it that is used to trace user activities in Windows Forms Application. In ASP.NET we use the Session object.
manv
|
|
|
|
|
OK, let me ask this question, how do you avoid multiple logins in windows forms application.
manv
|
|
|
|
|
There is no equivelent object in Windows Forms. There is also no such thing as a login to a Windows Forms app unless you code in your own security system.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If you want to control a user activities in windows environment, try to look at this article[^].
|
|
|
|
|
hello
i write this code from differnt examples.i want to use dataset in my code but i think dataset is working but this code is inserting data into my table tell me how i can i modify to get benefit of dataset. plz help me soon.
Dim mycon As OdbcConnection
Dim ds As New DataSet
mycon = New OdbcConnection("DSN=BLTPS;APP=Microsoft® Visual Studio .NET;WSID=BLHOMEPC;DATABASE=BLTPS;Trusted_Connection=Yes")
Dim selectString As String = "SELECT * FROM icloct"
mycon.Open()
Dim myOdbcCommand As New OdbcCommand
myOdbcCommand.Connection = mycon
Dim adapter As OdbcDataAdapter
adapter = New OdbcDataAdapter(selectString, mycon)
adapter.SelectCommand = New OdbcCommand(selectString, mycon)
adapter.Fill(ds, "icloct")
myOdbcCommand.CommandText = "INSERT INTO icloct(locid, locdes, adduser, adddate, addtime)VALUES ('klm','yes', '', '', '')"
adapter.InsertCommand = myOdbcCommand
myOdbcCommand.ExecuteNonQuery()
adapter.Update(ds, "icloct")
mycon.Close()
|
|
|
|