|
Maybe lol typo I'll check
Frazzle the name say's it all
|
|
|
|
|
WallHeight, Gauge, and/or WallLength are probably Nothing and not an actual object instance.
|
|
|
|
|
Sadly I also Misspelled it in the Data base(can You see the "L" on my forehead?)
Fixing all entries he say's while hanging his head low
Frazzle the name say's it all
|
|
|
|
|
Yep. WallHeight, Gauge, and WallLength are not defined or passed in as variables to your subroutine. I'm surprised that it compiles.
Using the debugger, step into the routine and examine the values of those variables. (you can do this by placing your mouse on top of the variable and the tool tip will show you the current value)
|
|
|
|
|
David Mujica wrote: I'm surprised that it compiles.
Option Explicit Off
Public Class Form1
Sub New()
InitializeComponent()
Text = CStr(Value_Of_A_Politicians_Promise)
End Sub
End Class
Bastard Programmer from Hell
|
|
|
|
|
Yep. I know that it could be done by using Option Explicit Off, but my VS environment has it set to default of "Explicit On".
Back in my days of programming Fortran on the VAX, we used to use some compiler directive which effectively forced you to declare all of your variable. I'm old school that way.
|
|
|
|
|
David Mujica wrote: <layer>we used to use some compiler directive which effectively forced you to declare all of your variable. I'm old school that way.
True, that's how things should be. Working without is asking for trouble, giving you a new and empty object when you have a typo in the variable-name.
..and it's not much extra work
Bastard Programmer from Hell
|
|
|
|
|
David Mujica wrote: I'm surprised that it compiles.
With 'Option Explicit Off', you're in for loads of surprises. Unfortunately, VB is often very forgiving.
|
|
|
|
|
Hi All
I am making a string from dataset and then converting to xml.while converting its giving me error unexpected symbol "=" at location
For Each row In dsGetBVItemDetails.Tables(0).Rows
strxmlString += _
"<ItemDetails>" & _
"<Item code=" + dsGetBVItemDetails.Tables
(0).Rows(i)(0).ToString() + ">" & _
"<Description>" +
dsGetBVItemDetails.Tables(0).Rows(i)(1).ToString() + "</Description>" & _
"</Item>" & _
"<ItemQty>" + dsGetBVItemDetails.Tables
(0).Rows(i)(2).ToString() + "</ItemQty>" & _
"<Message>" + dsGetBVItemDetails.Tables
(0).Rows(i)(3).ToString() + "</Message>" & _
"</ItemDetails>"
i = i + 1
Next
It is giving error while converting only when adding attribute "code" in element Item pls suggest
and then converting like this
XFinalXML = XElement.Parse(strxmlString.ToString())
xmlResponse = XElement.Parse(XFinalXML.ToString())
xmlResponseDoc = New XDocument(xmlResponse)
schemaResponse.Add(Constants.TARGETNAMESPACE, AppDomain
.CurrentDomain.BaseDirectory & "Schema\" & Constants.GetBVItemsResponse)
nsResponse = xmlResponseDoc.Root.Name.NamespaceName
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
Are you adding double quote characters around the attribute value that follows "<Item code=" ? You can check this by looking at the generated string in your debugger.
The best things in life are not things.
|
|
|
|
|
yes below is my code
For Each row In dsGetBVItemDetails.Tables(0).Rows
strxmlString += _
"<ItemDetails>" & _
"<Item code=" + dsGetBVItemDetails.Tables
(0).Rows(i)(0).ToString() + ">" & _
"<Description>" +
dsGetBVItemDetails.Tables(0).Rows(i)(1).ToString() + "</Description>" & _
"</Item>" & _
"<ItemQty>" + dsGetBVItemDetails.Tables
(0).Rows(i)(2).ToString() + "</ItemQty>" & _
"<Message>" + dsGetBVItemDetails.Tables
(0).Rows(i)(3).ToString() + "</Message>" & _
"</ItemDetails>"
i = i + 1
Next
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
No, you're not. The resulting string code should be closer to:
<Item code=""" + dsGet... + """>" & _
But, you shouldn't even be doing it this way. You're code is nearly impossible to read and makes it very difficult yo see what's going on. Look at my other reply.
|
|
|
|
|
To add to Dave's comments, you have ignored my suggestion and merely reposted the original code, minus the <pre> tags, so it's almost impossible to read. And it obviously does not include the double quotes; had you used your debugger you would have spotted that fairly quickly.
The best things in life are not things.
|
|
|
|
|
You're missing quotes around the value for code .
Concatentating string together to build an XML document is doing it the hard way and it's less forgiving of typos and invalid characters in the contents.
You might want to look into building it this way:
Dim xml As New XDocument
xml.Declaration = New XDeclaration("1.0", "utf-8", "yes")
Dim rootNode As New XElement("RootNode")
For index = 1 To 3
rootNode.Add(<ItemDetails>
<Item code=<%= index %>>
<Description>Some description text <%= index %></Description>
</Item>
<ItemQty><%= index %></ItemQty>
<Message>Item Message <%= index %></Message>
</ItemDetails>)
Next
xml.Add(rootNode)
Debug.WriteLine(xml.ToString)
Notice that any values are automatically put into quotes when needed. Plus, you get full Intellisense support and syntax checking in Visual Studio 2010.
|
|
|
|
|
Hi Every body...VANAKKAM..( good morning or afternoon or evening in Tamil Langauge)..I want to learn the basiclogic to create my own user control.
Please Guide me..
Selvaraj.G
|
|
|
|
|
In the IDE create a new User Control. Add controls to it and make sure all settings you require are persisted. Apart from that it's the same as creating a form.
You'd be better off learning how to create a controls in a language that hasn't been deprecated and is still supported. Move to .net; C# or VB.net.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
In the name of all that is holy, do not learn VB6.
Nobody uses it.
Switch to VB.Net.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hello every1
i want to make a program with vb2010 that can compare a wav file with a realtime recorded voice from microphone and triger something (lets say that a msgbox appear)if the microphone msg is closed to the recorded from a wav.
thnx in advance
speedydc
|
|
|
|
|
You'd have to do something along the lines of a sliding window Fast Fourier Transform or Discreet Fourier Transform on both sets of data. There are a couple of problems with this as you'll have to account for differing sample rates of your WAV file and the samples coming from the mic.
You might also want to look into Hidden Markov Models as they tend to be a bit more forgiving in the sample rate differences.
Good Luck!
|
|
|
|
|
Is it possible to copy a file to a destination that includes a shortcut link in the path? For example, below the \Staged\ is actually Staged.LNK that points to a diff. server. I normally would use the UNC path but am being asked to do this specifically. User has full rights on the directory as well.
<br />
'Statement fails.<br />
System.IO.File.Copy("\\Server\Data Dumps\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml", "C:\Documents and Settings\John Doe\Desktop\Staged\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml")<br />
<br />
'If I add-in Staged.LNK, the statement fails, without .LNK, VB creates an actual folder called Staged and copies the file into that folder vs. using the shortcut path (to a diff. server).<br />
My.Computer.FileSystem.CopyFile("\\Server\Data Dumps\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml", "C:\Documents and Settings\John Doe\Desktop\Staged\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml")<br />
Thanks for any help or comments.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Jon_Boy wrote: Is it possible to copy a file to a destination that includes a shortcut link in the path?
No, since the .lnk is a file, not a virtual path. The file-system treats it as a file, not as a NTFS Junction Point[^].
As an alternative, you can use VB.NET to read what the .lnk file is pointing to, and concatenate that to your path. You'd need to import a COM-library called "Windows Script Host Object Model", then you could run code similar to this;
Imports IWshRuntimeLibrary
Module ShortcutExample
Sub Main
Dim MyWshShell = new WshShell()
Dim MyShortcut = MyWshShell.CreateShortcut("C:\Users\Eddy\Desktop\SomeFolder.lnk")
Console.WriteLine(MyShortcut.TargetPath)
Console.ReadKey()
End Sub
End Module
Happy Programming
Bastard Programmer from Hell
|
|
|
|
|
Sounds like a plan. Thanks!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
You're welcome
|
|
|
|
|
Hello.
I am using VB 2010 under Windows XP to create a MDI Windows Form
application. Question : is it possible to change the color or the title bar
and of the border of the children forms, form by form ?
modified on Monday, July 18, 2011 7:27 AM
|
|
|
|
|
Only if you draw the ENTIRE form yourself. What you're doing is drawing whats called the "non-client" area. This means you'll have to override the WndProc method and handle, at a minimum, the WM_NCPAINT message. This tells your code to paint its non-client area. The form properties won't do you much good here are they only specify the client area dimensions and settings.
Docs on the WM_NCPAINT message[^].
|
|
|
|