|
|
I think , your URL is what i needed but i don't understand that :
SQLServer / SqlConnection (.NET) / Connect via an IP address:
"Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
Could you explain me what is it exactly ?
Thank you
So it isn't running better but thank you for the link .
I think , the probleme come from my sql server install
SeLoRBIS
|
|
|
|
|
Hi all,
Is there a way to validate an XML file in VB.NET. For instance, a user can import a file into my application. And my application will read the XML and perform some action on it. How can I make sure that the selected XML file is valid (contains valid elements)? Is there some way to compare a DTD in code?
Any guidance would be appreciated.
Thanks!
|
|
|
|
|
try to have a look at the XMLValidatingReader class in the .net framework. it does what you need
HiH
Briga
|
|
|
|
|
Thanks!
|
|
|
|
|
I have build an activeX controller in ATL VC++ that uses a window and shows camera captured frames, it works well in VisualC environment.
In Visual Basic 6, however, When I tried to integrate the control into a project, it was loaded ok but when I tried to save or run the project, I got a system Error
&H80004005 (-2147467259).
When I tried the same under .net environment, this problem didn't appear.
DO you have any idea what can be the problem or how can I debug it ?
Thanks
Amos.A
|
|
|
|
|
Can anybody tell me why the code below would execute IO.Directory.Move and then re-create the original folder name?
Private Sub renameFolder()
Dim Prompt As String
Dim oldFolderName As String
Dim folderName As String
Dim selectedPath As String
Dim newPath As String
selectedPath = TreeView1.SelectedNode.FullPath ' get the full path of the selected node
oldFolderName = TreeView1.SelectedNode.Text ' get the name of the selectd node
Prompt = "Enter the new name for: " & oldFolderName ' ask for the new folder name
folderName = InputBox(Prompt, "Rename Folder", oldFolderName) ' load the name into the variable 'folderName'
newPath = selectedPath.Replace(oldFolderName, folderName) ' build the new path by replacing the old name with the new
IO.Directory.Move(selectedPath, newPath) ' remove the old directory
TreeView1.SelectedNode.Parent.Nodes.Add(folderName) ' add the new folder to the treeView
TreeView1.SelectedNode.Remove() ' remove the old node from the tree
End Sub
Let me explain what is happening; When I step through this code with the debugger it seems to execute perfectly. After IO.Directory.Move(selectedPath, newPath) executes, the old folder is gone and the and the new folder is present.
The problem is that as the debugger exits Private Sub renameFolder() the old folder re-appears. At this point the new folder and the old folder are present.
Thanks
Brad
|
|
|
|
|
Hi,
i'm wondering how to "catch" when a pcmcia card (specifically a GSM modem) is inserted. I couldn't find anything in the .net framework documentation.
Any clue on how to do it?
Thanks
Briga
|
|
|
|
|
after days of search (but few minutes from this post) I managed to get to it.
Just override the wndproc and filter the WM_DEVICECHANGE message.
|
|
|
|
|
I am having a problem building a menu bar. My mdi parent loads a child form anchored to the left and top within the form load. This is to be my menu bar. Originally the client wanted the buttons on the menu bar (total of 6 buttons) to produce a submenu under the last button in the menu. The submenu would of course have options for whatever main menu button was clicked.
Now the client (now being several stages into development) would like the submenu (6 seperate panel controls populated with link controls) to appear to the right of the main menu item that was clicked.
Not a problem I thought... I had to extend the width of the menu bar to accomodate the width of the submenu and move them around a bit.
BUT now if there are other child windows open when the submenu appears, they are covered by the background of the main menu.
I tried making the bg of the mainmenu transparent, but then the desktop, not the MDI parent bg is visible.
So I created a transparent .gif, made that the backgroundimage for the mainmenu and got the same result as above.
Do I have to repaint the MDI Parent BG?
Has anyone ran into something similar?
All I want is the submenu to appear without the BG accompanying it.
Sorry for the long post, but it is about as best as I can explain it.
|
|
|
|
|
Beginning to think that this is not possible.
If I apply transparency to a MDI child, the same region within the parent form also becomes transparent (desktop visible).
|
|
|
|
|
OK so here was my way around it. Just never mind about transparency...
Used an owned form instead.
At the form level:
Public WithEvents subnav As New System.Windows.Forms.Form
and within the load event of my main menu:
<br />
'add the owned form to the MDI parent<br />
F1.AddOwnedForm(subnav)<br />
'a little config<br />
subnav.FormBorderStyle = FormBorderStyle.None<br />
subnav.Text = ""<br />
subnav.Width = 150<br />
subnav.Height = 100<br />
'moves it to the extreme right of the main menu<br />
subnav.Left = nav.Panel1.Width<br />
<br />
subnav.Top = 100<br />
subnav.BackColor = Color.AliceBlue<br />
And in the main menu buttons:
<br />
'Adds the existing panel from the main menu.<br />
'This kept me from having to move code and controls etc...<br />
subnav.Controls.Add(nav.Panel2)<br />
<br />
subnav.Controls.Item(0).Visible = True<br />
subnav.Controls.Item(0).Left = 0<br />
subnav.Controls.Item(0).Top = 0<br />
subnav.Show()<br />
There are probly better ways to do this, but....
It works. And the link control events within the added panels still behave as they should. Again, without rewriting or copying and pasting...
|
|
|
|
|
i need urgent help on my project.. i need to browse for an exe and add a new menu item. i want to run that exe by clicking that menuitem... pls help... i cant find a way to handle the event..iam not able to pass arguments to the event handler.. pls help me.....!!! thanks
|
|
|
|
|
several ways of accomplishing it....when you create the menuitem put the exe filename in the tag field ... handle all that type of menuitems handlers together and run the shell command with the tag field as exe filename
|
|
|
|
|
|
I wanted to read the version of a DLL through VB6. Please try and give a detailed description (or some example code) on how to do it.
I went through a similar article here. But since I am relatively new to handling assemblies in VB6, request you kindly elaborate on the solution.
Cheers,
Nagu
It does not matter WHAT you Say.
It does not matter WHEN you Say.
The only thing that matters is HOW you Say.
Cheers,
Nagu
|
|
|
|
|
|
Thats just what i wanted... Thanks a lot
Cheers
Nagu
|
|
|
|
|
Hello,
How to create a xml file through programming and populate data into that xml file at runtime?
Thanks & Regards,
Mythri
|
|
|
|
|
your question is very generic to me, thus the reply may be not exactly what you were looking for.....
1) create a dataset to hold the data (at design time or run time)
2) populate the dataset
3) save it to an xml file
let's suppose you created a dataset called a with a table called b and a single text field named c
dim ma as new a ' create the dataset
ma.b.addbrow("test") ' populate it
ma.writexml(filename) ' save it to xml
Briga
|
|
|
|
|
Hello,
How to create a xml file through programming and populate data into that xml file at runtime?
Thanks & Regards,
Mythri
|
|
|
|
|
Hello Friends,
Is it Possible in Windows Application To Upload a File to a Remote Server.Please Help soon If Possible.
hiiiiii
|
|
|
|
|
Of course. But, everything dpends on what type of server you're uploading to, ...which you didn't say anything about.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I wonder if someone has the knowledge I lack, I am trying to resolve a hostname through a proxy server in vb.net but I am figure out how to combine these subroutines?
This sub is to give a proxy server some credentials and download the html from the page
Warning **** imports system.net at top of code ****
Private Sub Myproxy()
Dim result As String = ""
Try
Dim proxy As WebProxy = New WebProxy("http://proxy:80/", True)
proxy.Credentials = New NetworkCredential("username", "password", "domain.com")
Dim request As WebRequest = WebRequest.Create("http://www.c-sharpcorner.com")
request.Proxy = proxy
Dim response As HttpWebResponse = CType(request.GetResponse, HttpWebResponse)
Dim stream As System.IO.Stream = response.GetResponseStream
Dim ec As System.Text.Encoding = System.Text.Encoding.GetEncoding("utf-8")
Dim reader As System.IO.StreamReader = New System.IO.StreamReader(stream, ec)
Dim chars(256) As Char
Dim count As Integer = reader.Read(chars, 0, 256)
While count > 0
Dim str As String = New String(chars, 0, 256)
result = result + str
count = reader.Read(chars, 0, 256)
End While
RichTextBox1.Text = result
response.Close()
stream.Close()
reader.Close()
Catch exp As Exception
Dim str As String = exp.Message
End Try
End Sub
This is the sub to resolve the hostname
Public Sub DisplayHostAddress(ByVal hostString As [String])
Try
Dim hostInfo As IPHostEntry = Dns.Resolve(hostString)
' Get the IP address list that resolves to the host names contained in the Alias
' property.
Dim address As IPAddress() = hostInfo.AddressList
' Get the alias names of the addresses in the IP address list.
Dim [alias] As [String]() = hostInfo.Aliases
MsgBox(("Host name : " + hostInfo.HostName))
'MsgBox(ControlChars.Cr + "Aliases : ")
Dim index As Integer
For index = 0 To [alias].Length - 1
MsgBox([alias](index))
Next index
'MsgBox(ControlChars.Cr + "IP Address list :")
For index = 0 To address.Length - 1
MsgBox(Convert.ToString(address(index)))
Next index
Catch e As Net.Sockets.SocketException
MsgBox("SocketException caught!!!")
MsgBox(("Source : " + e.Source))
MsgBox(("Message : " + e.Message))
Catch e As ArgumentNullException
MsgBox("ArgumentNullException caught!!!")
MsgBox(("Source : " + e.Source))
MsgBox(("Message : " + e.Message))
Catch e As NullReferenceException
MsgBox("NullReferenceException caught!!!")
MsgBox(("Source : " + e.Source))
MsgBox(("Message : " + e.Message))
Catch e As Exception
MsgBox("Exception caught!!!")
MsgBox(("Source : " + e.Source))
MsgBox(("Message : " + e.Message))
End Try
End Sub
so for example to resolve:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.DisplayHostAddress("http://www.codeproject.com")
End Sub
thanks
|
|
|
|
|
I want my VBScript to stop for 4 seconds before starting again.
Searched the web and found this "WScript.Sleep 4000".
The problem is that when I use this code i get an error "Object required 'WScript'".
What is wrong?
Is there a better way to do this?
Spaz
|
|
|
|