|
I am trying to create an application that can connect to a database on a remote server. If anyone knows how to achieve this or has any good reading material please could you let me know?
Any help is much appreciated.
McGann
|
|
|
|
|
Mc--Gann wrote: remote server
By this I assume you mean 'Not on the same Local Area Network'
Also, what type of database are you trying to connect to?
Steve Jowett
-------------------------
Real programmers don't use PL/1. PL/1 is for insecure momma's boys who can't choose between COBOL and Fortran.
|
|
|
|
|
Correct its over the web. It's a MSSQL database
ASP all the way
|
|
|
|
|
You can connect to SQL over internet. Check out ConnectionStrings.com for connection string.
|
|
|
|
|
thanks for the help
ASP all the way
|
|
|
|
|
You should be aware of firewall inparticular the UDP ports. MS SQL Server uses port 1440 as standard but is othen changed. Assuming the port is 1440 then in your connection string you will need to specify the port along with the server ip address, for example :
Data Source=123.123.123.123:1440;Initial Catalog=MyDatabase;User ID=MyUserId;Password=MyPassword
Steve Jowett
-------------------------
Real programmers don't use PL/1. PL/1 is for insecure momma's boys who can't choose between COBOL and Fortran.
|
|
|
|
|
Who in their right mind exposes a SQL Server directly to the Internet?? That's insane!
|
|
|
|
|
Fasthosts do and that seems quite secure to be honest, I can access it using management studio from my PC easily which makes for simple maintenance.
Phil
Software Developer
http://www.yorkshirehumberit.co.uk
|
|
|
|
|
I have developed a software using visual basic. It is designed to run in a network. I deployed the software on the application server and try running it on the same computer and it worked fine. I tried accessing it on my development pc and it worked fine as well, but when i tried accessing it to local computers/ clients, it gives me an assertion error and i don't know what to do with it.
I have three (3) assertion errors.
Debug Assertion Failed!
File : dbgdel.cpp
line 47
Expression: _BLOCK_TYPE_IS_VALID(phead->nBlockUse)
Debug Assertion Failed!
File: dbgheap.c
line: 011
Expression: crtIsValidHeappointer(pUserData)
Debug Assertion Failed!
File: dbgheap.c
line: 1017
Expression: _BLOCK_TYPE_IS_VALID(phead->nBlockUse)
I have until Friday to make my software work before it goes live, so i am in urgent need of help..
Any response will be deeply appreciated. Thank you
|
|
|
|
|
"dbgdel.cpp", "dbgheap.c", those are C files, not Visual Basic. Can you copy/paste the part of the source that's throwing the assertion?
I are Troll
|
|
|
|
|
I have a really weird problem. I had to make some adjustments to a VB6 application. So i installed Visual Studio 6 (with SP6) on my Windows 7 pc, i downloaded the project though Visual SourceSafe and after changing some filepaths in the projectfiles(had to be done because it had some absolute references in it) and recompiling some ocx file(because of a more logic file-location) i got the project to work on my computer.
I made my changes i checked-in the project again. Now a college of mine wanted to see the changes on his computer(with had a already working copy of the source). He got the latest version of the source code and opened the project. He got a error about visual basic not finding the ocx file i recompiled, but after registrating the ocx file he could open the project without a problem.
After hitting F5 he got the following error message: "System Error &H80004015 (-2147467243). The class is configured to be executed when a security-ID is different from the caller" << now don't know about the error message, i had to translate it, the original message was: De klasse is geconfigureerd om te worden uitgevoerd als een beveiligings-ID dat verschilt van de beller < witch is not correct dutch
His Pc is a Windows XP computer and also has Visual Studio 6 (SP6) installed. Can somebody please help me out with this really weird problem.
|
|
|
|
|
Did you unregister the old ocx and register the new one? (using regsvr32.exe )
I are Troll
|
|
|
|
|
Yes i did, but that didn't work... So i removed all registry entries that pointed to the ocx and registrated the new one. That didn't work too.
My last hope was a system restart, did it, and YES it works again!!!
Don't know what fixed the problem, but my solutions where:
- Recompiling the ocx on the other computer.
- Registrating all dll/ocx files again.
- Removed all registry entries of the ocx file.
- Registrated the ocx again.
- Restarted the computer.
|
|
|
|
|
I have a ContextMenuStrip that I am showing programmatically in response to a button being clicked. Everything works as expected, except that the Items in the menu do not respond to being moused over. Whether the mouse button is up or down, mousing over the menu has no visible effect, and releasing the mouse button does not select an Item, as expected. Performing a full click on an Item does still activate the Item, however.
Here's my code for showing the ContextMenuStrip:
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
MyBase.OnMouseDown(e)
If Enabled Then
m_MouseDown = True
If m_State > ButtonState.MousePressed Then
m_State = ButtonState.MousePressed
End If
Invalidate()
If DropDown IsNot Nothing AndAlso DropDown.Items.Count > 0 Then
If ShowMenu Then
ShowMenu = False
ElseIf arrowRect.Contains(PointToClient(MousePosition)) Then
ShowMenu = True
m_MouseHeldWhileOpened = True
DropDown.Capture = True
End If
End If
End If
End Sub
Protected Property ShowMenu() As Boolean
Get
Return m_showMenu
End Get
Set(ByVal value As Boolean)
If value <> m_showMenu Then
m_ShowMenu = value
If m_ShowMenu Then
m_DropDown.Show(Me, GetDropDownSpawnPoint, DropDownDirection)
m_State = ButtonState.MenuUp
If m_DropDown.ClientRectangle.Contains(PointToScreen(MousePosition)) Then
m_DropDown.Capture = True
End If
Else
m_DropDown.Close()
ElevateState()
End If
End If
End Set
End Property
I have tried a number of different ideas to get the menu to respond correctly, some of which attempts are still evident in the code here. If any help would be forthcoming, it would be greatly appreciated - nobody else on Google seems to have experienced this problem.
Thank you in advance for any help you can offer.
|
|
|
|
|
What are you trying to do that you have all this code in the mousedown events?
Whenever i have used context menu's in the past i haven't gone to all that trouble.
For example, the code below is handles on a button.click, It creates a new context menu, adds to click handlers for the menus events and shows the menu next to the button.
Private Sub ButtonSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
Dim theMenu As New ContextMenuStrip
theMenu.Items.Add("Export to XML", MenuExportXML.Image, AddressOf MenuExportXML_Click)
theMenu.Items.Add("Export to CSV", MenuExportCSV.Image, AddressOf MenuExportCSV_Click)
Dim p As New Point
p.X = ButtonSave.Width
p.Y = ButtonSave.Top
theMenu.Show(ButtonSave, p)
End Sub
|
|
|
|
|
Hi,everyone,now I need to write some texts to some cells with VB.NET ,sometimes I need the texts wrote in two lines or three lines in one cell.Just like below:
"ABCDEFG" ,in the cell it should like
ABC
DEFG
That is the question:could I control it with VB.NET?
Need some help or sugestion,Thanks a lot!
|
|
|
|
|
you did not say on what surface, in what Control, where at all this is going on.
Some Controls simply accept multi-line text and perform wrapping themselves; most of those also understand Environment.NewLine; some have a property you'd have to set true before they accept multi-line text; and some don't at all.
PS: all of them would tell you in the documentation, all it takes is to go to the appropriate page; I can't provide a link as I'm in the dark of the very nature of your cells.
|
|
|
|
|
I feel very very sorry for my carelessness that made you perplexed.What I wanted to say was "EXCEL cells" and the text came from some VB.NET controls such as TEXTBOX or COMBOBOX.
Luc,could you give me some suggestion now?THX!
|
|
|
|
|
I haven't done this myself, however I think "abc\ndef" will show as two lines in a single Excel cell if the cell formatting allows wrapping.
|
|
|
|
|
Since you're speaking about cells without additonal information I assume you might mean Excel cells. In that case I'd suggest to use VBA, which is integrated into Excel. Using VB.NET wouldn't make a lot of sense. Maybe you let us know more, we're only guessing here.
|
|
|
|
|
oh,I'm very very sorry for my carelessly! What I really want to say was "EXCEL CELLS"…
It seams that the problem only could be done with VBA…Em…I will try it .Thank you!
|
|
|
|
|
Hi, Dave's (the next) answer is exactly what I would have suggested.
Still I don't understand when you say the text comes from VB.NET controls - would that mean you would first have to grab the text from a different program? In that case it's a much (muchmuch!) harder job to do, so I hope I'm misinterpreting that remark . If you wanted to say "VBA controls" instead (i.e. inside Excel) then again it's something you can manage without going insane
|
|
|
|
|
While working in excel directly not via code, you can use ALT+Enter keystroke to achieve this.
While using code it is as simple as inserting a Carriage Return and Line feed into the string.
Private Sub doSomething()
Dim xlApp As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application()
Dim xlWk As Microsoft.Office.Interop.Excel.Workbook = xlApp.Workbooks.Add()
Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet = xlWk.Worksheets(1)
xlApp.Visible = True
xlSheet.Range("A1").Value = "Some Text Value on 1 line"
xlSheet.Range("A5").Value = "Some text value on" + vbCrLf + "2 lines"
xlSheet.Columns().AutoFit()
xlSheet.Rows().AutoFit()
End Sub
|
|
|
|
|
Hi,
Is it possible to create a new instance of a control if I only has the type of it?
E.g. Type of Button -> new instance of button
|
|
|
|
|
What other information do you think you might need?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|