|
mistyfy wrote: may i have the detail on this?
Read up on type casting.
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
mistyfy wrote: total_length = '"&label_total_length & " '
if total_length column is int, you cant use signle quotes. Single quotes are only used for varchar columns.
|
|
|
|
|
i tried to remove the single code but i stil got the error message that figure after the comma can't be save!!
|
|
|
|
|
Are you formating that numeric value? thats why the comma is there in the fist place right? Just reformat the value to remove the comma, or save the value in a variable before you formated that number.
|
|
|
|
|
'2,076' is a varchar data type 2076 is an integer - this is the frst issue
use convert or cast - read BOL for the details.
mistyfy wrote: SqlClient.SqlCommand(" UPDATE Dimension SET total_length = '"&label_total_length & " ')
SqlClient.SqlCommand(" UPDATE Dimension SET total_length = " + label_total_length.tostring())
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I created a few user controls. I created a separate class which contains a few data all these controls need
Public Class CExtraData
Private value1M As String
Private value2M As String
Public Property Value1() As String
Get
Return Me.value1M
End Get
Set(ByVal valueA As String)
Me.value1M = valueA
End Set
End Property
Public Property Value2() As String
Get
Return Me.value2M
End Get
Set(ByVal valueA As String)
Me.value2M = valueA
End Set
End Property
End Class
Every UserControl has an instance of a class as property such as
Private extraDataM As New CExtraData
Public Property ExtraData() As CExtraData
Get
Return Me.extraDataM
End Get
Set(ByVal valueA As CExtraData)
Me.extraDataM = valueA
End Set
End Property
If I use the UserControl in a form I would like to set the properties of the UserControl
... .ExtraData.Value1
... .ExtraData.Value2
by the designer. The property "ExtraData" shows in the property list of the designer but it is deactivated.
I tried following solutions:
+ Added "<serializable()>" in front of the definition of the class "CExtraData"
<serializable()> Public Class CExtraData
...
But it did not help.
+ Added Disigner-Attributes in front of the Property "ExtraData" in the UserControl:
< System.ComponentModel.Localizable(True), _
System.ComponentModel.DesignerSerializationVisibility( _
System.ComponentModel.DesignerSerializationVisibility.Content) > _
Public Property ExtraData() As CExtraData
...
But it did not help.
How can I solve it?
Michael
|
|
|
|
|
Maybee you kan change the extra info as a list(of object) that way you can add all kind of info you do not need another class and is easely accesebly
Jan
|
|
|
|
|
I got two solutions which both work properly. In the latter one you find a comparision of the two implementations
Michael
Version 1:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23661508.html
Version 2:
http://forums.msdn.microsoft.com/en-US/vbgeneral/thread/f3eaaee7-3b11-4a67-9f50-156020e66f1a
|
|
|
|
|
I am converting a VB6 app. The specific portion I am stuck on is reading a binary file and setting a bunch of fixed length variables (with nested loops, yadda yadda).
I'm getting some errors because I think the default value of the .Net fixed string is nothing, where as the fixed length strings in VB6 actually contain some form of value.
For example, take the following (from VB6):
BarNum2 As String * 2
If you add a watch, you can see the value is 2 square icons. The value is not "" or " ".
What I have in .Net:
<vbfixedstring(2),system.runtime.interopservices.marshalas(system.runtime.interopservices.unmanagedtype.byvalarray,sizeconst:>Public BarNum2() As Char
Looking at the default value in .Net is nothing.
How can I determine the character value of each square in vb6?
Odd question I know, but if any one can help, I'd appreciate it.
Thanks!
|
|
|
|
|
The defoult value is the lenght * chr(0). this is not a space but some char that is normely not used in text. the only place that I know it in some api/dll calls
Jan
hope this helps
if not try to debug.print all codes
For n As Integer = 0 To yourString.Length - 1
Debug.Print(CStr(Asc(yourString.Substring(n , 1))))
Next
and look at the values
|
|
|
|
|
I tried that as well the other day, but it was spitting out zeros for each char.
I starting going down through the vb6 key constants that were likely candidates: vbcrlf, vbcr, vbnull, vbnullstring, vbnullchar (Finally this one matched).
Thanks for the suggestion though!
|
|
|
|
|
Thats right. it shoud spill out zeros. thats what chr(0) means. remember that the ascII set exist of 256 chars 0-255
some examples:
32=space
64=@
65=A
97=a
all code below 32 are normely not visible and used for printer modems ...
Jan
|
|
|
|
|
We have different classes in System.Xml namespace in VB.net like XmlWriter and XmlReader... with the help of them we can retrieve different information from xml document.
Is there any way to manipulate controls like textboxes, checkboxes ,radio and submitting buttons? like sending some data to a textbox or getting data which is linked with Submit buttons etc?
|
|
|
|
|
Your question is kind of basic sounding, can you give a specific example of what you are trying to do?
|
|
|
|
|
a website shows result of some entry test conducted but you can access it only by the userID, (a number). It has just a textbox and a submit button. you enter the userID and submit it and the data is displayed to you ! like
ID NAME Marks obtained Percentage
in that format!
Now i want the entire result! I know that students were from id number 1 to 10,000! so in a loop i enter the id and retrieve the info linked with that id that is a student's result and I SAVE IT somewhere in a file like ms excel file or a word file.
Its not something illegal cuz i can sit and start entering IDs and writing down the result and so on but that ll be too dumb! i need all the result by an auto way(though it ll still take a bit time, hours maybe ) .
If any other legal way you ppl know than tell me...
|
|
|
|
|
Firstly, i don't care if its illegal or not. But you do sound guilty =)
Really though, you will need to use the WebRequest and WebResponse classes to programatically make requests and recieve responses to/from the site. Each response will need to be parsed so you get only the data you care about (no HTML tags, etc), and then you can save the result. There are a bunch of ways to do this, and a few dozen primers on using WebRequest, etc.
Be Careful not to make it too efficient. If you loop 10K times in a few minutes you are doing the same as a Denial of Service attack and will either get in REAL trouble, or your IP blacklisted from the site. Wait a few seconds (10-15) between each request to simulate a human use and let it run over night.
|
|
|
|
|
thanks!
and i don't feel guilty:P actually someone else said like its illegal at some other post so i veta clear it at the beginning
|
|
|
|
|
Hi,
I'm trying to recognize when the user clicks the + or - on a TreeNode in a WinForms TreeVeiw control. I want to update the icon depending on whether the parent node clicked is open or closed.
I've googled extensively, and can't seem to find this. I've subclassed the TreeView, and can intercept messages, but don't know how to proceed from here. I THINK I want to do something like:
If msg = WM_Notify Then
'figure out if it was the collapsed or opened message.. wparam?
'do what I want to do.
End If
Any ideas?
Also, where can I obtain a COMPLETE list of windows messages? I can't seem to find that either.
Thanks...
|
|
|
|
|
Look into the before/after collapse and before/after expand events.
|
|
|
|
|
That was dumb... I was looking all over for an API way to do this, and didn't notice the TreeView had Before- and After- Collapse & Expand events...
Thanks...
|
|
|
|
|
|
hi,
i've created a form with two checkboxes
at the time of retrieving the data from the database
firstly i cleared the binding
Me.chkIsError.DataBindings.Clear()
Me.chkIsBlock.DataBindings.Clear()
then i add the controls with new data
Me.chkIsBlock.DataBindings.Add("checked", dataseted.Tables("ClientaddMaster"), "IsBlock")
Me.chkIsError.DataBindings.Add("checked", dataseted.Tables("ClientaddMaster"), "IsError")
during this process the error message comes as:-
Object cannot be cast from DBNull to other types
i need to allow null for the checkboxes in the database due to which this error arises ...
is there any way to resolve this error...
|
|
|
|
|
NULL is not a valid value for the checkbox. Assuming your pulling data in from a select, wrap the columns with an isnull to the correct value.
|
|
|
|
|
Sorry For Butting in,
But how will you do that? i mean i dunno how to code that
|
|
|
|
|
Hello,
I have an access database and have a simple query in which i have 1 parameter.
I want to run this query in vb.net and display the results in a datagrid or anything but in vb.net.
I'm able to run the query but wht should i do to display the results of the query.
the code i m using now is:
Dim accApp As Object
accApp = GetObject("c:\mydb.mdb")
'this will run the query in the database
accApp.docmd.OpenQuery("myQuery")
accApp.Run("myQuery")
|
|
|
|