|
Sir
it's not giving the dtpicker.tostring
actually there is no method in dtpicker the "tostring" one.
so how can i do that?
kindly help me.
Have a nice day
Withe Regards
Alok Singh
|
|
|
|
|
sir Actually i am using datepicker so in that situation how can i convert
that value of "month/day/year" into "dd/mm/yy" format
Kindly hel me
Withe Regards
Alok Singh
|
|
|
|
|
You can use
dtpSomething.Value.ToString("dd/MM/yy")
|
|
|
|
|
Hello,
Try : Format(dateadd("m",-1,datetime.today),"dd/MM/yyyy")
|
|
|
|
|
|
First of all, you are confusing dates with strings. A date value doesn't have a format at all. The format is applied when you convert the date value into a string.
If you get a format that you don't want, it's because you have converted the date to a string without specifying what format you do want. If there is no format specified, it uses the format of the current culture.
When converting a date to a string, you can specify a specific format:
s = daDate.ToString("dd/MM/yyyy")
You could also specify a DateTimeFormatInfo or a CultureInfo object for the culture that uses the format that you want.
Tip: Use the methods of the DateTime structure instead of the VB6-ish methods:
daDate = DateTime.Today.AddMonth(-1)
---
b { font-weight: normal; }
|
|
|
|
|
Hi
how can i store a Datepicker value in a text variable?
i m using a datepicker1 n i want to convert into a text variable?
kidly help me
-with regards
Withe Regards
Alok Singh
|
|
|
|
|
You can use tostring
dtpTextStr= DateTimePicker1.Value.ToString()
or
dtpTextStr= DateTimePicker1.Text()
|
|
|
|
|
Hi all,
We have a program where in we write code to activate a AS400 machine and connect to it ,so that we have to get some text file from there and paste into our system.So anyone pls suggest the code pleaseeeeeeeeee.
Thanks in advance
Preethi
preethishivbaba
|
|
|
|
|
How is this text file exposed on the AS400?? Is it available via a web page? FTP server? Telnet? Without knowing how this file is made available, it's impossible to tell you how to get at it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
Any help or advice is appreciated. I am very new to programing VB.net 2005.
I have a table name Product in SQL2005 database. The product table has productName and Price. If the user select one of the product from combo box, I want to see the price only for that product listed in the text box.
Thanks for your help
TT
|
|
|
|
|
It depends on how you've written your code and database. But, in general, you have to get the Primary Key of the record that's selected in the ComboBox and use another SQL query to lookup the price associated with that record. You did put in ID column in your Product table, didn't you?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i want to show the text value from form in the data report but i have try many ways it just not working... or data memeber not found.
in my data report code i put:
label2.caption= module1.textfromform
textfromform which is a global varible i set in my module1.
but having error :"Object required".
i try to set the code in form. which is :
dareport1.label12.caption=text1.text
but Error:data memeber is not found
Hope someone can save me~~~
|
|
|
|
|
Try declaring your form with the data outside of any sub routines as Public frm1 as Form1 (or whatever it is that your form is called) & then modify
campbells wrote: dareport1.label12.caption=text1.text
to dareport1.label12.caption = frm1.text1.text
|
|
|
|
|
actually my text1.text= stringtext -- which is a global variable~
|
|
|
|
|
Global variables should be avoided. Nevertheless, in your module declare your string variable with either Public or Friend access modifier (Friend if it's withing the same assembly). Then try dareport1.label12.caption = modulename.variablename
|
|
|
|
|
i'm using vb6, i think dont have friend this command.
It is not working when i put this command
dareport1.label12.caption = modulename.variablename
it said Method or data memeber not found.
I try to check enter the datareport name first then i found that it only link to report properties, can found those label or text in m report...
|
|
|
|
|
I think you misunderstood my code snippet - modulename.variablename is supposed to represent the public variable in the module you are using to populate your data report, I put it in italics for as an example for you as I don't know what you've named the module or the variable.
The point I'm trying to make is, from what I understand, you have a module that populates the data report
Public Module basDataReport
Public strCaption As String '<--- global string variable
Function GetReportCaption()As String '<--- your method that gets report caption
''''''
''' <--- put your processing here e.g.
'strCaption = blah blah blah
'''''''
Return strCaption '<--- string variable with data
End Sub
End Module
Inside whichever method call it is that you're using to set the caption you could call MyReport.Caption = basDataReport.strCaption to get the global variable after it's already been assigned OR if you're using a function like in the example above you could call on the function by name e.g. MyReport.Caption = GetReportCaption() .
See what I mean?
|
|
|
|
|
is ok nvm , i solve my problem with this
<br />
With Vdetail<br />
.Sections("reportheader").Controls.Item("datefrom").Caption = strFromWhen<br />
.Sections("reportheader").Controls.Item("dateto").Caption = strToWhen<br />
End With
|
|
|
|
|
help guys... how can i enter next character in the text box using vb6? it so happen that i'm using hardware - buttons - in this program... using the inpout32.dll and the sort of thing... when i click the button to an specific number then click it again for other number, its just keep on changing the number in the text box - not adding the number that i have click... example: when i click number 1, 1 will appear in the text box, and then i will again click number 2 - the text box should display 12, since i click 1 before, ryt? but in this case, when i click the 2nd number which is 2, it simply replaces the 1st number - which is 1. guyd, can you help me with this? needed it badly thanks!!!
|
|
|
|
|
Try this:
In the code for the button, type:
TextBox.Text = TextBox.Text + Varible1
And replace "Varible1" with what you want to come next.
Hope this helps!
|
|
|
|
|
I am having a problem with the SelectedValue of a list box. I have a List Box that has its data source as a table. The columns in the table are ID and Name. ID is an Integer and Name is a String. I have them bound to the ListBox in this fashion:
ListBox.DataSource = Table1DataSet
ListBox.DisplayMember = “Table1.Name”
ListBox.ValueMember = “Table1.ID”
Whenever I try to use the value member of the list box I get an error. For instance if I declare:
Dim x As Integer = ListBox1.SelectedValue
It says InvalidCast Exeption. If I try to put it as a parameter for a sql query like
MyCmd.Parameters.AddWithValue("@FID", ListBox1.SelectedValue)
It gives an argument exeption when I try to fill my data adpater. Could someone tell me what I am doing wrong.
|
|
|
|
|
Have you used the debugger to see what's in the ID property ? Have you tried Convert.ToInt32 to convert it to an int ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have used
Dim x As Integer = Cint(ListBox1.SelectedValue)
and I still get an error message.
How do you use the debugger to see what is in the ID property?
|
|
|
|
|
Set a breakpoint and type ListBox1.SelectedValue in the watch window.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|