|
Hi, is that a way using VB6 to check printer status whether it connected or not connect to the printer device before print any job?
Please comment.
Thanks in advance.
Regards,
Jy
|
|
|
|
|
Hi all,
I have a server application awaiting incoming connections through a series of sockets set in "listen" mode. I have a number of client applications in remote locations that communicate via tcp/ip, opening the corresponding socket connection to the server and transmitting data.
The problem I have is that the client-to-server socket connections seem to die out after a while, specially in locations where internet is intermittent. When this happens, the connection does not terminate, rather it stays in "connected" state, but data transfer is lost in the web. Even though the winsock.state = sckConnected, the data is not received.
In order to solve this, I implemented a refresh timer, that closes and reopens all sockets in the server once every n seconds. It works, but it's terribly unelegant. I have found no other way of doing this, keeping the connections alive.
Anybody could please give me a suggestion on how this can be done properly? How can I determine if a connection is alive or dead, regardless of what .state says?
Thanks,
Regards.
|
|
|
|
|
are you using win sock . I had the similar problem before using win sock where i lost data even the client was connected with the server.
But later i used dart sock and it helped me you can get the trial version of these from www.dart.com and try it out, hope this would help you.
|
|
|
|
|
Yes, I use winsock. Thanks for the tip!!, but I think I might have solved temporally in a rather clumsy way.
I set up each client to "ping" the server every second. The server "pongs" to each "ping". I there is no "pong", the connection is down and a reconnect is issued. This check is performed at both sides.
Unelegant, but it works, and it´s free...
Has anybody implemented a different type of "keep alive" mecanism?
Regards,
|
|
|
|
|
I am getting ORA-01036 (Illegal Variable Name/Number) when I call the oracledataadaptor.update method.
I am able to fill the dataset & bind to the datagridview. When I try to update Oracle with the dataadaptor,
I get the Illegal Variable name exception.
Any ideas?
Thanks in advance!
' '' ''' '''' Call the update method
Try
daCustomers.Update(ds.Tables("Customers"))
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
' '' ''' '''' Set up Oracle Update Command
Private Sub SetCommands()
Dim uCMD As New OracleCommand
uCMD.Connection = cnOra
uCMD.CommandType = CommandType.Text
uCMD.Parameters.Add("@inFNAME", OracleType.Char, 30, "FNAME")
uCMD.Parameters.Add("@inID", OracleType.Int32, 12, "ID")
uCMD.CommandText = "Update NYOUG_CUSTOMERS SET FNAME = @inFNAME WHERE ID = @inID"
daCustomers.UpdateCommand = uCMD
End Sub
|
|
|
|
|
The syntax of bind variables depends on the connection type you use. Try using : instead of @ . For example:
kermit888 wrote: uCMD.CommandText = "Update NYOUG_CUSTOMERS SET FNAME = @inFNAME WHERE ID = @inID"
uCMD.CommandText = "Update NYOUG_CUSTOMERS SET FNAME = :inFNAME WHERE ID = :inID"
The need to optimize rises from a bad design
|
|
|
|
|
I tried switching the "@" with ":" but got the same result.
|
|
|
|
|
Did you also replace it in parameters. You could also try without semicolon and perhaps with less info to the constructor. Meaning, try both variations:
uCMD.Parameters.Add(":inFNAME", OracleType.Char, 30)
uCMD.Parameters.Add(":inID", OracleType.Int32) and
uCMD.Parameters.Add("inFNAME", OracleType.Char, 30)
uCMD.Parameters.Add("inID", OracleType.Int32)
The need to optimize rises from a bad design
|
|
|
|
|
I'm having problems using the Web Browser control in Vista. When I go to a page with any type of Flash Content it won't load. I went to the Flash plugin page and it said 64bit web browsers are not supported. This only happens on the Web Browser Control that I am programming with. If I just open the Microsoft Internet Explorer 7 it works just fine and has no problem loading Flash content. If I can't display Flash content it's a big problem so if anybody can point me in the right direction it would surely make my day.
Thanks In Advance
PS I have tried both the com version and the one that comes with VB.Net
both will not display Flash Content
I am using Vb.Net 2008 Express
Operating System Vista Home Premium Service Pack 1
Ken
|
|
|
|
|
Hi Guys...
i am using vs2005 to develeop my apps.
i need to install a simple application that uses crystal reporting on a windows server 2008 environment.
the error i am getting is that when i call up my report it reports back an error stating that i dont have the right CRRedist*.msm installed......
i have included in my mergemodules the Crystal Redistributable 2005_x86.msm.....
does anyone have an idea where i can get the 64 bit msm file from as i searched google and business objects but cant find it....
thanks in advance
Anoop Brijmohun
|
|
|
|
|
Hi
Am a newbie on VB.NET...Please i would like to know how would i authenticate users on the web application using their domain name and username (eg. FVCJBN01\F2999999) and also get their roles here is how my User table looks
USER_EMPL_NO F2999999
USER_LOGIN FVCJBN01\F2999999
USER_NAME Lisa Lopes
USER_CO_CODE 80
USER_BRN_CDE 189
USER_EMAIL lopes@test.co.za
USER_TYPE AdminOnly
HEAD_OFFICE_FLAG 0
USER_ACTIVE_FLAG 1
the application should pick up the user from their machines where they have logged on with their user authentication and check it against the database
|
|
|
|
|
Hi,
I am writing a programe for project report. i need code in vb.net 2005 for send SMS or dial phone no th Atteched mobile Mobile on PC.
How it will Possible.
PLZ Help me.
Thanks & Regards
Form :-
Vikash Yadav
|
|
|
|
|
What have you tried so far? Searched on Google?
|
|
|
|
|
first detect the communication port which u r connected mobile to the pc.
open the communication port.
and send commands.
to send SMS:- at+cmgs="+919000234140"<vbcrlf>
>hi <ctrl+z>
to dial number :- atdt+91900234140;<vbcrlf>
** note : the above commands are not suitable for all mobile manufactures.
there may be a change in the command, so search the AT commands list in internet(recommended GOOGLE).
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Hello to everyone.
I have the problem with my experimental, tutorial project (made in VB.NET) of syncing Microsoft SQL Server Standard Database (it is server) and MS SQL Compact DB (it is client). The synchronizer is based on MS Sync Framework (MSF) API classes.
The problem happens with SyncAgent Class. I created the class mySyncAgent which inherits the SyncAgent class. In the mySyncAgent I just gave settings for Local and Remote Providers (connection strings, sync type, direction etc - everything like it was described in MSDN tutorial example).
Now I try to make synchronization by using the method: statistics = myAgent.Synchronize where statistics is the instance of SyncStatistics class, and myAgent is the instance of SyncAgent class.
When I do it, the program stops to run and VB.NET compiler shows me the following error>: Method not found: 'Microsoft.Synchronization.Data.SyncException Microsoft.Synchronization.Data.SyncExpt.AnotherSyncInProgressError(System.String, System.String)'.
It is very strange error and I don't understand what causes it. First, there is no synchronization.data.syncexception library - it exists in another, older version of that class - but I can say for 100% sure that there is no conflict of versions generally in this project - so this is not a cause, not a reason. Anyway, the problem is not because of the missing method (there is a new one, in a new version), but the fact that Another Sync is in Progress. But I didn't call synchronization anywhere else except this method "statistics = myAgent.Synchronize" (I checked if there are other callings of .synchronize - there are no calls; neither in constructors nor anywhere else). I was doing debugging with tracing of variables, parameters of objects. This is the content of this variables at the run-time error.
myAgent:
*RemoteProvider: Everything is OK (like I set) - i.e. Connection Strings, SyncAdapters etc
*LocalProvider: Here is the most interesting stuff that (maybe) calls this error. There is subproperty "ClientID" which contains 2 properties called "Message" with the same content:
"Method not found: 'Microsoft.Synchronization.Data.SyncException Microsoft.Synchronization.Data.SyncExpt.AnotherSyncInProgressError(System.String, System.String)".
And property StackTrace of ClientID contains " at Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.BeginTransaction(SyncSession syncSession)
at Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.get_ClientId()"
What could be the cause of this problem? Could it happen because the connection to localProvider (based on MSSQL Compact 2005) is not open (by some reason)?
If anyone could just tell me where the possible mistake could be???
Thank You
Igor
|
|
|
|
|
Hello All,
How can I search for a particular file inside the .zip file?
Thanks in advance
Amit
|
|
|
|
|
Check out the System.IO.Packaging namespace (.net 3.0 or 3.5). It allows you to create zip files so I'm guessing if there is a way it will let you do it.
|
|
|
|
|
I am using Crystal Report in vb.net 2005 I am passing a parameter from form to Crystal Report, If i click on Refresh button in Crystal Report Viewer is Asking to enter Parameter value.
Now my problem is If i refresh in Crystal report viewer it should not ask for parameter value and it should assign old values passed through program.
Can any one help me ASAP
dim rpt as new rptsales
rpt.SetParameterValue(0, "cy")
rpt.DataSourceConnections.Item(0).SetConnection("", "shinepos", False)
rpt.DataSourceConnections.Item(0).SetLogon("sa", "nimda")
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.DisplayGroupTree = False
|
|
|
|
|
Hii
I m working on excel with vb.net 2005. and i have 2 sheet in excel workbook. and want to add the reference of sheet A to sheet b and change the format of values in sheet B.
How can i do this.
Please suggest.
Thanks
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
|
|
|
|
|
i have created a window service but it gives the following error
"The remote server returned an error: (407) Proxy Authentication Required."
why ?
this service is running under "LOCAL SYSTEM" SO WHY it doest not work?
if i provide the username and password than it works why ?
local system account is the most priviliged account in service context
so why it is like so ?
thanks in advance
Protected Overrides Sub OnStart(ByVal args() As String)
write()
End Sub
Sub write()
Try
Dim url As String = "http://www.yahoo.com"
Dim pr As New WebProxy("172.16.88.39", 8080)
pr.Credentials = CredentialCache.DefaultCredentials
Dim g As HttpWebRequest = WebRequest.Create(url)
g.Proxy = pr
Dim r As HttpWebResponse = CType(g.GetResponse, HttpWebResponse)
Dim sw As StreamWriter = New StreamWriter("c:\Weblog.txt", True)
sw.AutoFlush = True
sw.WriteLine(Date.Now.ToString & "-----------" & r.StatusCode.ToString)
Catch ex As Exception
MessageBox.Show(ex.Message, "Web Listner", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
End Try
End Sub
hello
|
|
|
|
|
The proxy server is telling you that authentication is required and not the service.
|
|
|
|
|
hi..,
i think your pc connected through proxy,
do this
go to internet explorer -> tools-> internet optons->
go to connections tab--> lan settings -> in the popup box unchech all the check boxes. close the IE
run your application
this may help U....
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
The proxy is telling you that the LocalService account is not authorized to use the proxy. You have to supply the proxy with credentials, specifying an account that DOES have access to use the proxy.
|
|
|
|
|
Hi - I have a VB.Net app that controls several devices - including a servo on a USB/Com port using a VCP - I am adding another device with another USB/Comport VCP driver and my vb.et program will not send the write buffer contents to the port, but does not throw an error but hangs on the next read.
I have tested the interface and device (a USBI/O24R board) using hyperterminal and the device and ports work fine.
Lots of time searching for a similar problem - no joy - so here are a few questions.
Is there a limit on how many USB/Serial (virtual COm Port) emulators in a system. Is there a problem with high com munbers (I started at 17) - but I should point out that I move the USB/Serial port to com2 with the same results.
Is there a problem with the USBI/O24R driver ? I have had a few emails with the chip supplier but no help yet except try getting to a lower com port - no results.
Below is an extract of my test code . . .
I added the GetSerialPortNames to see what was happening - POrtmon shows tthe name of the port and the open/close and a single write of "0A" but none of the data string. No change when the VCP was forced to Com2
Thanks for the help
Bob
__________________________________________
Public SwitchCommName As String = "COM2"
Public SwitchCommSpeed As Integer = 9600
Public SwitchCommParity As System.IO.Ports.Parity = IO.Ports.Parity.None
Public SwitchCommDataBits As Integer = 8
Public SwitchCommStopBits As System.IO.Ports.StopBits = IO.Ports.StopBits.One
Public SwitchComDataOut As String
Public SwitchCommFlowControl As System.IO.Ports.Handshake = IO.Ports.Handshake.None
Dim SwitchCom As SerialPort = My.Computer.Ports.OpenSerialPort(SwitchCommName, SwitchCommSpeed, IO.Ports.Parity.None, SwitchCommDataBits, IO.Ports.StopBits.One)
Public SwitchCommdataOut As String
Public SwitchCommDataIn As String
Public Switch_WordOK As Boolean = False
Sub InitializeRemoteSwitch()
Call GetSerialPortNames()
MsgBox("OK")
SwitchCom.DiscardInBuffer()
'ID device First
SwitchCommdataOut = "?TTTTTTT" '& vbCrLf
SwitchCom.WriteLine(SwitchComDataOut)
Try
SwitchCommDataIn = SwitchCom.ReadLine()
MsgBox(SwitchCommDataIn)
Catch ex As Exception
End Try
'Set I/02 as Input (switch), I/04 as output (Red) and I/06 as Output (Green)
'Default is input
'Values = 2 , 8 and 32 so output total is 40
Dim SwitchCommOutputSelect As Integer = 40
Dim SwitchCommBothLightsOn As Integer = 40
Dim SwitchCommGreenLightOn As Integer = 32
Dim SwitchCommRedLightOn As Integer = 8
Dim IOValA As String = System.Convert.ToChar(SwitchCommOutputSelect)
SwitchCommdataOut = "!A" & IOValA
SwitchCom.WriteLine(SwitchComDataOut)
'Set both lights on
SwitchCommdataOut = "A" & System.Convert.ToChar(SwitchCommBothLightsOn)
SwitchCom.WriteLine(SwitchComDataOut)
MsgBox("Both Lights")
'Set red light on
SwitchCommdataOut = "A" & System.Convert.ToChar(SwitchCommBothLightsOn)
SwitchCom.WriteLine(SwitchComDataOut)
MsgBox("Red Light")
'Set Green light on
SwitchCommdataOut = "A" & System.Convert.ToChar(SwitchCommBothLightsOn)
SwitchCom.WriteLine(SwitchComDataOut)
MsgBox("Green Light")
Dim I As Integer
For I = 1 To 10
'Get Switch Data
SwitchCommdataOut = "a"
SwitchCom.WriteLine(SwitchComDataOut)
Try
SwitchCommDataIn = SwitchCom.ReadLine()
MsgBox(SwitchCommDataIn)
Catch ex As Exception
End Try
Next
End Sub
Sub GetSerialPortNames()
' Show all available COM ports.
For Each sp As String In My.Computer.Ports.SerialPortNames
ListBox1.Items.Add(sp)
Next
End Sub
|
|
|
|
|
Hi all,
Any help with this one very much appreciated (I've spent weeks on it (on and off) and it is driving me mad...)
I have a need to retrieve and set the raw values of a joystick (not the calibrated values returned normally). The code is written in VB.NET and uses DirectInput.
My code works at present but returns calibrated data (so a range of 0 - 65535). A snippet of the code below:
My question is: How can I retrieve (and set) the raw data values returned by each axis?
My reading did point me at IDirectInputDevice8::SetProperty, and to use the DIPROP_CALIBRATIONMODE parameter - but I can't work out how to do this in vb.net.
(In case anyone is wondering why I would not use the control panel to calibrate a joystick - I need this code as the program will manually 'calibrate' the pots out of a joystick on a DIY motion platform simulator we are building - and we wish to use joystick pots as the feedback mechanism).
Again - thanks in advance to anyone that can help.
Dim devices As Microsoft.DirectX.DirectInput.DeviceList
Dim device As Microsoft.DirectX.DirectInput.DeviceInstance
Dim Joystick As Microsoft.DirectX.DirectInput.Device
Dim JState As Microsoft.DirectX.DirectInput.JoystickState
'Get all the devices of type joystick
devices = Microsoft.DirectX.DirectInput.Manager.GetDevices(DeviceType.Joystick, EnumDevicesFlags.AllDevices)
'Do we have at least one Joystick?
[...]
devices = Microsoft.DirectX.DirectInput.Manager.GetDevices(DeviceType.Joystick, EnumDevicesFlags.AllDevices)
[...]
'Move to the first
devices.MoveNext()
'Now get the first device.
device = devices.Current
'Now get joystick handle to the device
Joystick = New Microsoft.DirectX.DirectInput.Device(device.InstanceGuid)
'Tell the joystick to behave itself as we want it to.
Joystick.SetCooperativeLevel(Me, CooperativeLevelFlags.Background + CooperativeLevelFlags.NonExclusive)
Joystick.Acquire()
Joystick.Poll()
JState = Joystick.CurrentJoystickState
Joystick.Poll()
JState = Joystick.CurrentJoystickState
TBJoyX.Value = JState.X
TBJoyY.Value = JState.Y
|
|
|
|