What Will Format(VerifyDay, "yy_") And Format(VerifyDay, "y_") Return
May 4, 2011what will Format(VerifyDay, "yy_") and Format(VerifyDay, "y_") return? given VerifyDay is current date.
View 3 Replieswhat will Format(VerifyDay, "yy_") and Format(VerifyDay, "y_") return? given VerifyDay is current date.
View 3 RepliesIn the function it returns the no in one digit .I want it to always return 2 digit number.Like if it is 0, it should return 00.
Public Function GetHexColor(colorObj As System.Drawing.Color) As String
Return Hex(colorObj.R) & Hex(colorObj.G) & Hex(colorObj.B)
End Function
I am using richtextbox in vb.net , which contains the value "ΡΠ΅ΠΊΡΠΈΡ", which is russian word.rtf1.selectedrtf and rtf.rtf, it returns /Un representation of characters. Is there any way or option in rtf to return the value in uXXXX format?.
ΡΠ΅ΠΊΡΠΈΡ='f1'e5'ea'f6'e8'ff
ΡΠ΅ΠΊΡΠΈΡ=u0441u0435u043Au0446u0438u044F (<-- i need this format)
=============================
rtf1.text=ΡΠ΅ΠΊΡΠΈΡ
[code]....
For years I never had trouble with this String. Format function until today when I got a value longer than 0 characters and the function returned all the characters in the string instead of just ten. Now sometimes I get less than ten characters so I can't use the substring with out getting an error. I can try the left function but I was hoping there was a solution with the Format function.
View 6 RepliesI am new to working with XML and have a question. I can recover any one value from an XML file but how do I recover 2 values from the same file and align them into a column format.
This is what I have been doing so far:
Dim doc As New System.Xml.XmlDocument
doc.Load("C:a_xmltestingDev_Clean.xml")
Dim list = doc.GetElementsByTagName("product") 'this returns the product ok
Dim list2 = doc.GetElementsByTagName("product_code") 'this returns the product code ok
I can pass either list into this and recover the values but not both
For Each item As System.Xml.XmlElement In list2
Debug.WriteLine(item.InnerText)
Next
Can I pass 2 GetElementsByTagName into a list?
I'm returning a database query into a List object and using that list object to fill the X and Y axes of my chart as seen below. (_runData is a "List(of DatabaseTableName)" style Object filled with the results of my query.
Primary_Chart.Series(0).Points.DataBindXY(_runData, "DateTime", _runData, "UPPER_PRESSURE")
My Datetime field is returning as a Serial Number (i.e. 40116.76111) so I want to format the X Axis to display the field more readably. Enter my problem code.
[code].....
Im looking for a class or code in VB.NET that can convert a black and white image in JPEG format to a grayscale TIFF format.
View 2 RepliesI'm creating a VB app that uses the Infragistics UltraGrid to display data from 2 JD Edwards files. Before the data is displayed, first I need to convert 2 date fields that are in JD Edwards Julian date format (i.e., 111158 for 6/07/11....the 158th day of this year) to mmddyy format.
MCTS: Web Apps, MCTS: Windows Apps, MCTS: SQL Server 2005, MCP: Windows XP Professional, A+, Network+, Linux+, Security+, Master CIW Designer, SCJP
I am using VS 2005 pro and VB.NET. How do you format the DataGridView.DefaultCellStyle.format property for zip codes and phone numbers. I have a zip code and phone number column(s) that I want to be formatted. I have tried a lot of different things:
Zip code: "99999-0000" or "Phone Number: "(999)000-0000" or "(000)000-0000" and the like So far nothing has worked. I can get my date columns formatted correctly, but not these. Can any one give me some examples that work?
I need to take a string formatted like '010711' (DDMMYY) and put it into format '01-Jul-11'. Ive thought about doing something like string.toArray and then having some conditionals that format from there but am looking for an easier way.
View 5 RepliesWhen retrieving rows from an SQL Server table I use the following code select mydate, Customer, Details from sales where mydatetime >= '" & format (somedate, "MMM d, yyyy h:mm:ss tt") & "'"This works fine unless the clients computers windows Region setting is 'English (New Zealand)'The default time format in windows Region and Language for New Zealand is [code]On computers with this region setting I get an SQL Error 'Conversion failed when converting date and/or time from character string'..If I manually select the other option for AM symbol, PM symbol in Region and Language i.e AM PM the all works fine again..What format string can I use so that above code always works, even if the Region time format is a.m. / p.m.
View 1 Repliesformat Gridview's unbound column in 12hr format? i tried the following code, it didnt work.
[Code]...
I have a DGV that is getting data from a sql db. The dates in this db are stored as doubles ie 40025.708681
How do I format this column as Date/Time?
I tried but this doesn't seem to work.
how to do this? DGV1.Columns("HostDate").DefaultCellStyle.Format = "d"
I am trying the following to select a long date, but becase the value is stored in SQL database as DateTime I am unable to return any results unless minutes and seconds match perfectly...I then tried to use 2 calendars and have the same issue with the DateTime format..
CODE:
The bottom line on a dropped-down datetimepicker shows the date different then in the text-part.In my case, the text-part format was yyyy/mm/dd, but the bottom part of the dropped down part stated Today: dd/mm/yyyy, what is probably the format set in the regional settings.
View 5 RepliesI have to text file in the following format :
Word[tab][tab]Word[Carriage Return]
Word[tab][tab]Word[Carriage Return]
Word[tab][tab]Word[Carriage Return]
I want to get all the words before the tab into one array or to create a new text file and the all the words after the tab into another array or create a new text file too.
Here my function to get the words before tab into an array :
Protected Sub MakeWordListBeforeTab()
Dim filename As String = "D:laoοΏ½0001.txt"
'read from file'
[Code].....
I wrote the above function to get all words before tab but I got all the words into array. I've been trying to use the Split method above. What is another method to split those words ?
I know this can be done with regular expression but I don't know regex yet. If you can show me how to get this done with regex it'll be awesome.
i just started usign Vb two days ago, as it was required for work and i just wondered how to change the format of the total into a money format
View 3 RepliesHow to convert jpg format into binary format using VB code ?
View 3 RepliesI want to format the Timespan to have format like this 49 hr 34 mn 20 sec
I used the String format below :
String.Format("{0:00}:{1:00}:{2:00}", theTimeSpan.TotalHours, theTimeSpan.Minutes, theTimeSpan.Seconds)
It formats the Timespan to this format 49:34:20. How can I add hr mn sec to the String.Format above? or there's another easy way?
How would I format txtLabel.Text to a currency format?
The text would be 15000000
I would like the text to show $15,000,000
How to format drive in FAT 16 format using VB.NET without user interaction?
View 1 RepliesI am using String.Format("{0:C2}", -1234)to format numbers.is always formats the amount to a positive number, while I want it to become $*-*1234
View 4 RepliesIn India and other Asian countries money is formatted as following:The first three digits grouped in three then all other digits are grouped in pair of two.eg : 2,54,255.12 5,22,54,255.12 etc string money = String.Format("{0:#,##0.00}", 254255.12);
gives the output 254,255.12
but the output required is 2,54,255.12
All of my regional settings in control panel are set to UK but when I retrieve a date from an SQL database (run from my PC) in my program, it appears in the MM-DD-YYYY format rather than the DD-MM-YYYY format that I expect.
After a bit of troubleshooting I found that this is because of the fact that SQL server always stores its dates in that format - so then when my program reads the data from the database it interprets it as being the US format.How can I convert this to UK format bearing in mind I am working with Date objects not strings?
How to convert eps format to jpg images in VB.NET?
View 3 RepliesI am trying to do a custom date format in VB.net using Format. The data coming in is "2009-10-03 00:00:00.000" and I want it to be "OCT 03 2009 12:00AM". I am using Format(object, "MON DD YYYY HH:MIAM") and am getting screwy results ... "2006-09-17 00:00:00.000" becomes "9ON DD YYYY 00:9IA9".
View 2 Repliesi see that i can use defaultcellstyle.format to format a column but what if i have an number stored as a string "0511" and i want to display it as a integer "511"
View 6 RepliesMyRow = MyDT.NewRow()
MyRow(1) = rs2.Fields("Field29").Value.ToString
rs2.Fields("Field29").Value has values like "YYYYMMDD" in a string.how can i convert a "YYYYMMDD" string to a needed date format like 'dd mmm yy' (or any format)
This the test example.
Dim dt As DataTable = New DataTabledt.Columns.Add("StartTime")dt.Columns(0).DataType = System.Type.GetType("System.TimeSpan")
[code]....
var queryString = string.Format("filename={0}&filestream={1}&append={2)", fileName, Convert.ToBase64String(b, 0, bytesRead).ToString(), 1);
above line of code giving error 'Input string was not in a correct format.'