|
I can't tell because you didn't post the connection string, but the common problem in connecting to an SQL Server from a Windows Service is using Integrated Security. The Local System account has no permissions to SQL Server, so the connection will not work.
Best practice is to NOT use integrated security, unless absolutely necessary and, instead, create a user account in SQL Server that the Service will use to connect to SQL Server. This gives you much greater control over what that account can and cannot do in SQL, resulting in greater security of your data.
|
|
|
|
|
i have included account and problem persist.
|
|
|
|
|
When you added the username and password to your connection string, did you ALSO remove the Integrated Security option from it??
|
|
|
|
|
|
Can I execute an exe in a windows application ? My exact requirement is,
on the button click event I should run the exe in the same window where the button resides. Right now I am using process.start() to execute, but it is opening a new window.
Thank U all,
Kiran
|
|
|
|
|
There is a CP article on this. It's a real hack ,but you can do something. Odds are you're going to break your app tho, I would not do it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Thank U Mr.JZ, I will try with this.
with regards,
kiran
|
|
|
|
|
Hi,
Please forgive my lack of knowledge and this silly question. I would like to replace the (#?#) in the input string "5#A# 10#B#", to make it look like "5? 10?" and then display it in a richtextbox.
(the ? marks above should be the figures in the title)
Is this possible? can anybody teach me how to?
Thanks a lot!
Joe
|
|
|
|
|
alexvw wrote: Is this possible?
You might want to look at regular expressions on this, also for the heart, diamond, club, and spade characters, look in the symbols font and supply the ascii code for them in your regular expression.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi Paul,
Thanks for the tip! I will look into it. A few hours ago I just tried setting the font of the control to one that supports unicode to see what happends, and "Presto" I got the figures I needed.
Once again, thanks for your time. I will really look into it.
Joe.
|
|
|
|
|
I am actually suprised you got the symbols to show up correctly in the title, I thought their were web limitations preventing them.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Hi... I'm working on a project for a site I'm doing which gets SMS' from a GSM Modem, so far it's going okay... But I've hit a slight problem.
I've been though pretty much every page on Google and still no luck.
<br />
#Region "SMS"<br />
Public Sub openModem()<br />
Try<br />
Modem.Open()<br />
Catch ex As Exception<br />
<br />
End Try<br />
<br />
Thread.Sleep(7000)<br />
<br />
ModemWrite(" ", False) ''Seems to wake up modem<br />
MsgBox(ModemWrite("AT+COPS?", True))<br />
End Sub<br />
<br />
Public Function ModemWrite(ByVal WriteString As String, ByVal ExpectReturn As Boolean) As String<br />
Dim ReturnString As String = ""<br />
Modem.DiscardOutBuffer()<br />
Modem.DiscardInBuffer()<br />
<br />
<br />
Try<br />
Modem.Write(WriteString)<br />
Application.DoEvents()<br />
Catch ex As Exception<br />
<br />
End Try<br />
Thread.Sleep(1000)<br />
If ExpectReturn = True Then<br />
If Modem.BytesToRead = True Then<br />
<br />
ReturnString = Modem.ReadExisting<br />
<br />
End If<br />
<br />
End If<br />
<br />
Return ReturnString<br />
End Function<br />
#End Region<br />
I can talk to the modem though HyperTerminal, and the code above seems to be sending the commands.... But I don't seem to get any thing back other than a space.
I've tried using the event handler... and still nothing...
If anyone has any ideas, I'd love to hear them.
Thanks,
Aaron
|
|
|
|
|
This is what I did to recieve data to my app.
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
'' Threading.Thread.Sleep(500)
Try
txtResults.Invoke(New myDelegate(AddressOf updateTextBox), New Object() {})
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Public Delegate Sub myDelegate()
Public Sub updateTextBox()
With txtResults
.Font = New Font("Arial", 10.0, FontStyle.Bold)
SerialPort1.ReadExisting())
.AppendText(SerialPort1.ReadExisting())
.ScrollToCaret()
End With
'THIS WILL ONLY WORK WHEN CONNECTED SerialPort1.Close()
End Sub
Hope this helps!
rudy
|
|
|
|
|
Thanks for your help.... but it didn't work
I ended up with
#Region "SMS"
Public Sub openModem()
Try
Modem.Open()
Catch ex As Exception
End Try
Thread.Sleep(7000)
ModemWrite(" ", False)
MsgBox(ModemWrite("AT+COPS?", True))
End Sub
Public Function ModemWrite(ByVal WriteString As String, ByVal ExpectReturn As Boolean) As String
Dim ReturnString As String = ""
Modem.DiscardOutBuffer()
Modem.DiscardInBuffer()
Try
Modem.Write(WriteString)
Application.DoEvents()
Catch ex As Exception
End Try
Thread.Sleep(1000)
If ExpectReturn = True Then
While ReturnStringTXT.Text = ""
Application.DoEvents()
End While
While Not ReturnStringTXT.Text = ""
ReturnString = ReturnStringTXT.Text
End While
End If
Return ReturnString
End Function
Private Sub ModemDataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles Modem.DataReceived
Try
ReturnStringTXT.Invoke(New smsDelegate(AddressOf updateTextBox), New Object() {})
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Public Delegate Sub smsDelegate()
Public Sub updateTextBox()
ReturnStringTXT.Text = Modem.ReadExisting()
End Sub
#End Region
Popped up with an exception...
Am I doing something wrong?
Thanks,
Aaron
|
|
|
|
|
What's the exception? I'm ussing the serial port control, you may have to modify it. This came from a program that I used to replace Hyper terminal. If you want, I can supply the whole code. It might give you an idea what to do. let me know.
Rudy
|
|
|
|
|
Here's the exception:
System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.<br />
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Objects[] args, Boolean synchronous)<br />
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)<br />
at Application.GUI.ModemDataReceived(Objects sender, SerialDataReceivedExentArgs e) in C:\Application\Server
Any ideas?
Thanks,
Aaron
|
|
|
|
|
Woop.... Fixed
All it was, was not finishing the lines with vbCrLf....
9 hours wasted
Thanks anyway,
Aaron
|
|
|
|
|
Hi All,
While calling the SP which updates the TABLE(SQL SERVER) thru Stored Proc,
i'm getting an error "x parameter was not supplied".
x is the datetime value. I ll pass the system time in that parameter.
I'm facing this problem only for the Datetime Values.
No probs with the code as everything works fine in my system where i developed this app. But after deploying in the client machine i'm facing this prob.
Dont ask me how this is happening, but its happening.
Can anyone help me in this issue.
--Raam
|
|
|
|
|
PLease don't cross post. I have just answered this in the sql forum
Bob
Ashfield Consultants Ltd
|
|
|
|
|
If I can have somebody point me in the right direction.
I have a 2 ip cameras, hooked into a network switch. The I have two decoders that hooked into the switch. Now I have VGA monitors on the other side of the decoder.
So I want to write a program that I can press a button click event. And camera 1 will send the video siginal to monitor 1 or 2, depending on what button I click.
How would I go about doing this? I was thinking maybe I control this throught the network switch via rs232. Or can I send a command direct to the camere or decoder, which also has an IP address.
Where would I start looking for stuff on this?
TIA!!
Rudy
|
|
|
|
|
I would choose for a hardware switch solution... Connect both camera's to a switch box which outputs to a monitor. No PC Needed. You can however create something like that, but you need to exactly specify your needs else we cannot help you... I think the solution you want is close to a DirectShow[^] solution but you may have a hard time developing the application. There are some examples out there, I also managed to get something to work in DirectShow... If I can do it, anybody can...
|
|
|
|
|
Hi Ed!
Thank you for the reply. I plan to have one computer, one network switch, and then my monitors and cameras all hooked into a network switch. With a video switch, I can sedn a AT command via RS 232. But a network switch, I'm not sure if I can dial into specify what jack to connect with what jack?
|
|
|
|
|
Anybody can help me please!
I have a asp.net page (vb) where I need to create Dynamic Controls. the situation is as follow
I have two links one is inside the panel (add range) and other is outside the panel (add component).
when I click the addrange then the four text boxes are going to add in the panel and when I click on addcomponent then one panel with dropdown box is going to create on the page. I done it but when I click the addcomponent the panel is adding on the page but the boxes on the first panel comes down with the 2nd added panel and first panel does not contain addrange text boxes. I am using webcontrol files. AddRange.ascx and AddComponent.ascx. my code is as follwo.
-----Add Panel----
'Add Panel (component)
Private Sub AddAndRemovePanel()
Dim c As Control = GetPostBackControl(Page)
If Not IsNothing(c) Then
If c.ID.ToString = "btnAddComponent" Then
ltlCountH2.Text = Convert.ToInt16(ltlCountH2.Text) + 1
End If
End If
PH2.Controls.Clear()
Dim ControlID As Integer = 0
For i As Integer = 0 To (Convert.ToInt16(ltlCountH2.Text) - 1)
Dim DynamicUserControl As AddComponent = LoadControl("AddComponent.ascx")
While InDeletedList1("uc1" & ControlID) = True
ControlID += 1
End While
DynamicUserControl.ID = "uc1" & ControlID
AddHandler DynamicUserControl.RemoveUserControl1, AddressOf Me.HandleRemoveUserControl1
AddHandler DynamicUserControl.SelectComponent, AddressOf Me.handleSelectComponent
PH2.Controls.Add(DynamicUserControl)
ControlID += 1
Next
populateADDComponentDropDown()
' MsgBox(ltlCountH3.Text)
' MsgBox("ltlCountH3=" & ltlCountH3.Text)
' MsgBox("ltlCountH1=" & ltlCountH1.Text)
' MsgBox("ltlCountH2=" & ltlCountH2.Text)
End Sub
Private Function InDeletedList1(ByVal ControlID As String) As Boolean
Dim DeletedList() As String = ltlRemovedH2.Text.Split("|")
For i As Integer = 0 To DeletedList.GetLength(0) - 1
If ControlID.ToLower = DeletedList(i).ToLower Then
Return True
End If
Next
Return False
End Function
Sub HandleRemoveUserControl1(ByVal sender As Object, ByVal e As EventArgs)
Dim DynamicUserControl As AddComponent = sender.parent
PH2.Controls.Remove(sender.parent)
ltlRemovedH2.Text &= DynamicUserControl.ID & "|"
ltlCountH2.Text = Convert.ToInt16(ltlCountH2.Text) - 1
End Sub
--------AddRange-------------
'Add Range in Panel
Private Sub AddAndRemoveDynamicControls2()
Dim c As Control = GetPostBackControl(Page)
If Not IsNothing(c) Then
If c.ID.ToString = "btnAddRange" Then
ltlCountH3.Text = Convert.ToInt16(ltlCountH3.Text) + 1
End If
End If
'PH3.Controls.Clear()
Dim ControlID As Integer = 0
For i As Integer = 0 To (Convert.ToInt16(ltlCountH3.Text) - 1)
Dim DynamicUserControl As WebUserControl = LoadControl("AddRange.ascx")
While InDeletedList("uc3" & ControlID) = True
ControlID += 1
End While
DynamicUserControl.ID = "uc3" & ControlID
AddHandler DynamicUserControl.RemoveUserControl, AddressOf Me.HandleRemoveUserControl2
For Each c2 As Control In PH2.Controls
If c2.GetType.Name.ToLower = "addcomponent_ascx" Then
Dim uc As UserControl = CType(c2, UserControl)
Dim mypanel As Panel = uc.FindControl("panel1")
mypanel.Controls.Add(DynamicUserControl)
Else
MsgBox("not found")
End If
Next
'PH2.Controls.Add(DynamicUserControl)
ControlID += 1
Next
End Sub
Private Function InDeletedList2(ByVal ControlID As String) As Boolean
Dim DeletedList() As String = ltlRemovedH3.Text.Split("|")
For i As Integer = 0 To DeletedList.GetLength(0) - 1
If ControlID.ToLower = DeletedList(i).ToLower Then
Return True
End If
Next
Return False
End Function
Sub HandleRemoveUserControl2(ByVal sender As Object, ByVal e As EventArgs)
Dim DynamicUserControl As WebUserControl = sender.parent
PH3.Controls.Remove(sender.parent)
ltlRemovedH3.Text &= DynamicUserControl.ID & "|"
ltlCountH3.Text = Convert.ToInt16(ltlCountH3.Text) - 1
End Sub
|
|
|
|
|
We have an ASP.NET forum.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|