|
Perhaps not triggering an event per se, but Microsoft SQL Server does have the ability to work with COM objects, which you could use to signal an application.
The method I've used may be a bit Rube Goldberg-ish, but it does work for what we need.
An incredibly simple VB6 COM object was created which does nothing more than issue a TCP connection request to a computer and port specified in the lone Ping method. A multi-threaded VB.NET application was written which listens on a given port for inbound connection requests. When one is received, the connection request is dropped and a short countdown timer is started. Additional connection requests reset the countdown. When the countdown has elapsed, the pending items in the queue are processed.
We have also used SQL Server's COM object functionality to make a better email component (one that can take queries and format the results as HTML tables).
|
|
|
|
|
Depends on the version of SQL Server you're using. It won't be an event like you see in, say, the button class, but yes, you can get notifications. Google for "SQL Server Notification Service".
|
|
|
|
|
It seems that I can assign the value of a cell by dbl-clicking on the cell like this
In this event handler
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
TextBox1.Text = dgView1.CurrentCell.Value
However the first column of data does not work the same way. If I dbl-click on it It does not fire the event but if I click on the column header the data will populate the textbox??
Is there something I am missing??
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
modified on Tuesday, August 12, 2008 12:07 PM
|
|
|
|
|
Are you certain you are clicking on the 1st column and not the header for the rowheader column.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
My bad I was in cell changed event....working now..
THX to all
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
I want to do some scientific calculations to evaluate a scientific equation.
I want to develop a component in VB.net to perform the arthematic calculations with required precission(Which is more than 30 digits after decimal point).
Can some one help me with this.
Ram
|
|
|
|
|
|
In the early '80s, a friend wrote an application on an 8 bit machine to calculate PI to the nth decimal place. Obviously, the floating point accuracy of an 8 bit machine would not suffice, so, he stored his data in character strings and manually performed the necessary calculations one column at a time. Assuming you have a formula or some other such means, use character strings and arrays.
Enjoy!
Tim
|
|
|
|
|
I am looking some thing like PI calculations
I tried it in the following way. Write a method for userdefined datatype and then use the operator overloading concept for operators(+,-,*,/) to perform arthmatic calculations with that new data type.
Public Function UDDouble(ByVal strDouble As String, ByVal intScale As Integer) As String
'Dim obj As String = "1.12345678903322112233"
Try
Dim strTemp As String() = New String(intScale) {}
Dim temp3 As String = ""
If strDouble.Contains(".") Then
Dim temp1 As String = strDouble.Split(".")(0)
Dim temp2 As String = strDouble.Split(".")(1)
If intScale > temp2.Length Then
For i As Integer = 0 To temp2.Length - 1
temp3 += temp2(i)
Next
For j As Integer = temp2.Length To intScale
temp3 += "0"
Next
Else
For i As Integer = 0 To intScale - 1
temp3 += temp2(i)
Next
End If
temp1 = temp1 + "." + temp3
Return temp1
Else
Return strDouble
End If
Catch ex As Exception
Throw New Exception(ex.Message)
End Try
End Function
Dim arr1 As Double() = {2, 2, 7}
Dim arr2 As Double() = {1, 2, 8}
Dim arr3 As Double() = {0, 0, 0}
Dim carry As Integer
Dim borrow As Integer
Dim chrOperator As Char
Dim holdDigit As Integer
Select Case chrOperator
Case "+"
For i As Integer = 2 To 0 Step -1
'for addition
holdDigit = arr1(i) + arr2(i) + carry
carry = holdDigit \ 10
arr1(i) = holdDigit Mod 10
Next
Case "-"
For i As Integer = 2 To 0 Step -1
'for substraction
holdDigit = arr1(i) - arr2(i) + 10
borrow = holdDigit \ 10
arr1(i) = holdDigit Mod 10
If i = 0 And borrow = 0 Then
Throw New Exception("2nd number larger than first one")
Else
If (borrow = 0) Then arr1(i - 1) -= 1
End If
Next
Case "*"
For i As Integer = 2 To 0 Step -1
'For Multiplication
holdDigit = (arr1(i) * 128) + carry
carry = holdDigit \ 10
If i = 0 Then
arr1(i) = holdDigit
Else
arr1(i) = holdDigit Mod 10
End If
Next
Case "/"
'for Division
For i As Integer = 0 To 2
holdDigit = arr1(i) + borrow * 10
arr1(i) = holdDigit \ 128
borrow = holdDigit Mod 128
Next
End Select
Can some one let me know wether this approach is correct or not? If not please let me know the best possible way to do this.
Ram
|
|
|
|
|
Hi
i wants to create(Write) file in selected font, can i have any idea?
Hitesh sojitra
|
|
|
|
|
No, you can not.
Plain text files do not contain any information regarding formatting like font size, color, margin etc...
|
|
|
|
|
|
I believe, he is looking for .txt and not .rtf
|
|
|
|
|
Oooh, yeah. You're right.
|
|
|
|
|
Hi,
How i findout the total number of repitation of strings in an string array
please give me suggestion that how i do that.
i have stored strings in an array and now i have to findout how many times it repeates in an array.
Regards
Rameez
|
|
|
|
|
Please don't cross post.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Your asked essentially the same question 7 hours ago... try to work it out for yourself.
Write it out on paper and work through the problem.
|
|
|
|
|
<br />
Dim Count as Integer<br />
For each i in MyArray<br />
if i.contains = "YourString" then<br />
count += 1<br />
next<br />
Something like that?
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
Can anyone please tell me how to integrate VB.Net codes into powerbuilder in order to run one application
modified on Tuesday, August 12, 2008 8:46 AM
|
|
|
|
|
Do you think any body has this much time to read your code.
Please be specific of your requirement
|
|
|
|
|
Hi
I want to make a formula builder, in which user can take his own variable and by using that variable he can make his own formula and can check it whether its valid or not and when he enter a value for specific variable then he can get result.Its basically used in Payroll System
Like
if user takes one variable 'X' and make a formula like (X/24)-1
now when user select a different value for X then he can get result
modified on Wednesday, August 13, 2008 1:23 AM
|
|
|
|
|
OK - sounds like fun. Do you have a specific question ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I want to check whether a given text File is Already Opened or not. I am using Visual Basic 6.0 in the Windows XP OS.
I am using the following code. It works for .doc, .xls and .mdb. But its not working for .txt file type
Code:
--------
Public Function IsFileOpen(FileName As String) As Boolean
On Error GoTo ErrHandler
Open FileName For Binary Access Read Lock Read As #1
MsgBox Input$(LOF(1), #1)
Close #1
Exit Function
ErrHandler:
MsgBox "File is Already Opened"
End Function
|
|
|
|
|
Hi,
Try the following code:
BEGIN CODE
Try
Dim fs As FileSream = File.OpenWrite(strFileName)
If(fs == null) Then
// your Code
End If
Catch e As UnauthorizedAccessException e
/The file is open by another app
End Try
ENE CODE
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
The code will work, so long as the other app keeps the file open. For instance, Notepad does NOT do this. It opens the file, reads the entire contents, then closes it. Only then do you get to the see the text in Notepad. There is no way to tell if this has happened or not...
|
|
|
|