|
Write the expression in the database and during the evaluation of the formulas, use Infix to Postfix or Prefix and then evaluate.
|
|
|
|
|
I had download a online website. when i running site on local.I found the error:
"The virtual path '/Templates/mysite/Main.master' maps to another application, which is not allowed."
plz help me.
Thanx
uttam
uuttam.xevoke@live.com
|
|
|
|
|
uttam kr wrote: plz help me.
What do you want help with? You haven't asked anything only made the statement that you copied someone else's work and can't figure out how to do it on your own.
only two letters away from being an asset
|
|
|
|
|
I'm trying do run the Ole DB below with OleDBCommand but I'm getting a strange error, OleDB doesn't have some functions implemented?
SELECT
[Plan1$].[Cliente] AS [Cliente0],
CONVERT(varchar, DATEPART(q,[Plan1$].[Data]) % 2 + 1) + 'S/' + DATENAME(yyyy,[Plan1$].[Data]) AS [Data1]
FROM [Plan1$]
ORDER BY [Plan1$].[Cliente] ASC, [Plan1$].[Data] ASC
ConnectionStr: Provider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\works\Clientes.xls";Extended Properties="Excel 8.0;HDR=YES;"
Error: System.Data.OleDb.OleDbException: Sintax error 'CONVERT(varchar, DATEPART(q,[Plan1$].[Data]) % 2 + 1) + 'S/' + DATENAME(yyyy,[Plan1$].[Data])'.
|
|
|
|
|
Hi, Is there not a VB6 forum here? please direct me where to find it as my question is related to VB6.
I'm connecting client to server using VB6 Winsock Controls
'==========Server side============================
Winsock1.Protocol = sckTCPProtocol
Winsock1.RemoteHost = strParm(0)
Winsock1.RemotePort = 1002
Pause (7)
MsgBox "Before Connecting" 'just to do something, and give time to establish connection
Winsock1.Connect
MsgBox "After Connecting"
DoEvents
'Delay2 = 1
Pause (10)
Winsock1.SendData ("Starting dropship refresh...")
It works fine with the MsgBox between the Connect and the Senddata, but without it gives an error when firing Senddata method, seems because connection is not established quick enough.
Please help, how can I ensure connection before sending data?
I have tried some 'delay' processes which works 1 minute and doesnt the next.
Thanks in advance
P
|
|
|
|
|
There is a Visual Basic forum.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
VB6 has some rudimentary error-handling. Wait a sec, try to connect, and if it fails then try again in two seconds. Repeat for three to five times, and show a message that there's connectivity-problems if you cannot connect after that.
I haven't got a VB6-IDE at home, but this should give you a basic idea;
Private Sub WaitForAwhile(howLong as Int)
Dim currentTime
currentTime = timeGetTime
While (timeGetTime - currentTime) < howLong
DoEvents
Wend
End Sub This should allow a pauze while processing continues. Next, to the connection-routine;
Private Sub TryConnect()
On Error Goto myErrorHandler
Dim Tries%
Tries% = 0
TryAgain:
Winsock1.Connect
WaitForAwhile(1000)
Winsock1.SendData ("I will gladly beam down to the planet, Captain!")
Exit Sub
myErrorHandler:
Tries% = Tries% + 1
If Tries% < 5 Then
Goto TryAgain
Else
MsgBox "Cannot connect, try the sneakernet :)"
End If
End Sub
I are Troll
|
|
|
|
|
Hi Thanks Eddy,
I did put in some sort of delay similar to yours, it works the one minute and the next it doesnt, I even increased the time delay to maximum, but still same problem.
How can I get rid of this problem permanently.
P
|
|
|
|
|
she-Developer wrote: I did put in some sort of delay similar to yours, it works the one minute and the next it doesnt, I even increased the time delay to maximum, but still same problem.
Did you get an error-message of any kind? I can't debug from here, so I'm kinda guessing.
Perhaps you can let the application dump the contents of a ping (shell a command, "ping >C:\result.txt") to check connectivity if the loop fails five times.
I are Troll
|
|
|
|
|
I just had a look of some of my own code and found that every time, before I connect I follow the following logic:
(I cut out alot of irrelevant code such as error handling etc. so I may have made a mistake somewhere but you should get the general idea)
Sub AttemptConnectionToRemoteHost()
'(wsh is my client winsock control)
If wsh.State <> sckClosed Then
wsh.Close
End If
wsh.RemoteHost = RTrim(LTrim(txtAddress))
wsh.RemotePort = CLng(txtPort)
wsh.Connect
Await()
If wsh.State = sckConnected Then
'Report success!!
Else
'Report Failure
End If
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Await()
'Allow x seconds to for connection
Dim x As Long
Dim EndTime As Single
x = CLng(5) 'Allow 5 seconds for connection attempt
EndTime = Timer + x
Do
DoEvents
Loop While (wsh.State <> sckConnected) And (EndTime > Timer)
End Sub
This should do the trick for you. I found that, always checking that the port's state is sckConnected, before attempting anything with it, is a good failsafe. Use the Await() procedure above to ensure that the port is CONNECTED before continuing. You could bring the 5 seconds down to as little as 1 second for local LAN applications.
modified on Thursday, October 22, 2009 2:39 AM
|
|
|
|
|
We have a transport class, one of the members is
private object _containerObject; with get/set methods. In our system this container object can contain every .net type, every class in our B.O layer, or a List<T> of those types, we also have a WebService with a method returning a transport class object, the problem is that this fails:
GenericTransportObject resoultGTO = new GenericTransportObject();
TestService.Service1 ourService = new TestService.Service1();
resoultGTO = ourService.WS_Input(gto);
The error I get is:
System.InvalidOperationException: The type BOLayer.UserInformation was
not expected. Use the XmlInclude or SoapInclude attribute to specify types
that are not known statically.
what happens in the web service is that the method creates a new GenericTransportObject, sets the metadata and set the _containerObject to a object of type UserInformation, and returns that object.
I get a message telling me to use XmlInclude or SoapInclude, but how do I do it, when the class I need to edit is a base class in a compiled .net assembly?
I hope I have explained the problem well (English isn’t my first language).
modified on Tuesday, October 20, 2009 8:04 AM
|
|
|
|
|
VS2008 and DotNet 3.5 with SP/1, on a 64-bit machine:
I'm trying to use registered window messages to communicate between applications. All apps/components are compiled to x86.
Here's my interop stuff (in a class library):
namespace Utility
{
public class WinAPI
{
public const string REGISTERED_MSG = "AllInOneDemo";
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint RegisterWindowMessage(string lpString);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
public static int SendRegisteredMessage(uint message, int lParam, int wParam)
{
return SendMessage(IntPtr.Zero, message, lParam, wParam);
}
}
}
Here's my registering code:
private uint RegisteredMessage = WinAPI.RegisterWindowMessage(Globals.REGISTERED_MSG);
Here's my message sending code (the return value is always 0):
int result = WinAPI.SendRegisteredMessage(this.RegisteredMessage, 123, 456);
And finally, here's the message handling code:
protected override void WndProc(ref System.Windows.Forms.Message msg)
{
base.WndProc(ref msg);
if (msg.Msg == this.RegisteredMessage)
{
this.listBoxPublicMsg.Items.Add(string.Format("{0}\tLParam={0}\tWParam={1}", msg.Msg, msg.LParam, msg.WParam));
}
}
One application registers/sends the message, and one application is supposed to register/receive the message. The message is being sent, but it's not being received.
I have verified that both apps are getting the same return value when calling RegisterWindowMessage. The sending app appears to be sending the message, but the receiving app never sees it.
I tried using Spy++(64-bit) to look only at the Registered messages for both apps, but I get nothing at all for either window.
What am I doing wrong?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.
Microsoft Windows Vista and later. Message sending is subject to User Interface Privilege Isolation (UIPI). The thread of a process can send messages only to message queues of threads in processes of lesser or equal integrity level.
So where SendMessage(IntPtr.Zero,....) should be SendMessage(0xFFFF,....) I'll leave you to defined/consted 0xFFFF as HWND_BROADCAST.
|
|
|
|
|
Yep. That was the problem. I don't know quite where I got it in my head that a hwnd of 0 would do that (but to me it makes sense).
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
hi,
SendMessage needs a handle the message shell be send to.
in your case it is a IntPtr.Zero.
If you want your other application to receive the msg than give the handle by SendMessage of the application or use the HWND_BROADCAST to send the message to all the top-level windows in the system.
greetz and good luck
|
|
|
|
|
John Simmons / outlaw programmer wrote: One application registers/sends the message, and one application is supposed to register/receive the message. The message is being sent, but it's not being received.
I think your SendMessage function needs the HWND_BROADCAST value in the first parameter in order for your message to get to the other applcation. See SendMessage[^] on MSDN, for the details.
|
|
|
|
|
Hi my name is Manish.M.Meshram
I download oracle 10g.
i used scott tiger as userId and Password,
but it is not working.
what will be the user id and password
for oracle 10g.
Thank you
|
|
|
|
|
I need the default mail program name. Dou you any information guys? Thanks.
|
|
|
|
|
Take a look at HKEY_CLASSES_ROOT\mailto registry entry. I believe it will have the default mail client details. I am not sure about any Win32API which gives the default client details.
Best wishes,
Navaneeth
|
|
|
|
|
I have an unusual problem that I've never encountered before. I have a listbox on a form that indicates that it is executing the commands that it is updating itself programmatically, but it never does visually.
I have it where a list of users comes from the server and gets displayed in a listbox to all the clients connected to the server. All the messageboxes indicate that it is working programmatically, but the listbox never stops displaying the default items I typed in to test it.
I'm pretty sure its something very simple that I'm overlooking. Any help will be greatly appreciated.
Mike Rainey
--------------------------------
|
|
|
|
|
I'm not going to download, open and study your ZIP file, and I doubt anyone else will either. That is not how things work around here. You can ask for general advice; or show some code, give symptoms and ask for ideas.
Is your Form still alive, does it react to resizes, button clicks, etc? If not, one of your handlers is stuck, it never finishes.
Did you use threading? Are you trying to touch Controls from some other thread? If so read this[^].
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
OK, I'll take the link to the code down. Stupid, I know, but I can't seem to figure this out.
The form is still active and still responds to other events. All the other commands of all the other events work with no problem, except when it comes to the listbox, then the execution of the rest of the code in the function ceases.
Here is the code for the sub that just stops when it gets to the clearing out of the listbox items in the USERS part of the Select Case statement. This sub is in a module. I get the same result whether I reference the listbox with "frmServerConnect.lstUsersOnline" or "Public whatever As ListBox = frmServerConnect.lstUsersOnline".
Public Sub ReceiveMessage(ByVal ar As IAsyncResult)
Try
Dim bytesRead As Integer
bytesRead = client.GetStream.EndRead(ar)
If bytesRead < 1 Then
Exit Sub
Else
Dim messageReceived As String = System.Text.Encoding.ASCII.GetString(data, 0, bytesRead)
Dim myRegex As New Regex("\[(JOIN|LEAVE|USERS|ROLL)\](\[([^\]]+)\])?(\[([^\]]+)\])?")
If myRegex.IsMatch(messageReceived) Then
Dim myMatch As Match = myRegex.Match(messageReceived)
Select Case myMatch.Groups.Item(1).ToString
Case "JOIN" '==== [JOIN][Nick][Role] ====
frmServerConnect.lstUsersOnline.Items.Add(String.Format("{0} ({1})", myMatch.Groups.Item(3).ToString, myMatch.Groups.Item(5).ToString))
Case "LEAVE" '==== [LEAVE][User] ===
Try
'frmServerConnect.lstUsersOnline.Items.RemoveAt(frmServerConnect.lstUsersOnline.Items.IndexOf(myMatch.Groups.Item(3).ToString))
Catch ex As Exception
End Try
Exit Select
Case "USERS" '=== [USERS][User1Name|User1Role;User2Name|User2Role,etc] ===
Dim usr() As String = myMatch.Groups.Item(3).ToString.Split(";")
frmServerConnect.lstUsersOnline.Items.Clear()
For Each u As String In usr
Dim x() As String = u.Split("|")
frmServerConnect.lstUsersOnline.Items.Add(String.Format("{0} ({1})", x(0), x(1)))
Next
Case "ROLL"
'txtMessageHistory.AppendText(myMatch.Groups.Item(5).ToString)
Exit Select
Case Else
Exit Sub
End Select
End If
End If
'---continue reading for more data
client.GetStream.BeginRead(data, 0, CInt(client.ReceiveBufferSize), AddressOf ReceiveMessage, Nothing)
Catch ex As Exception
' MsgBox(ex.ToString)
End Try
End Sub
Mike Rainey
--------------------------------
modified on Monday, October 19, 2009 2:58 PM
|
|
|
|
|
My best guess is you brought that upon yourself: I see a try-catch with an empty catch block.
Never have an empty catch block.
I allow for one situation with an almost empty catch block:
- it only catches a very specialized exception;
- and it contains a comment explaining why it is mandatory to ignore this exception
Otherwise, make sure every exception leaves a trail.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
Thanks for all the help. I'm trying to get used to using sockets and that link regarding crossthreads hit the spot.
The empty catch block is there because I just haven't filled it yet. I get to coding and overlook some things sometimes.
Mike Rainey
--------------------------------
|
|
|
|
|
raineym wrote: The empty catch block is there because I just haven't filled it yet
You'd better put something useful in the catch block before putting anything in the try block. The payback is immediate! In fact I would like the compiler to flag empty catch blocks as an error.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|