|
Does anyone have sime codes to apply custom formatting to Dates (specifically Now()). I have a need to write different parts of the current date, including the time as YYYYmmDD as well as HHMM. The way we did it in VB 6 is not effective in VB .net 2005. Please help! TIA
|
|
|
|
|
Check out Formatting Date & Time in .Net[^]
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
FYI: I found some useful help at the address below. Basically, by using the code below, I was able accomplsh my mission.
(Format(Now, "yyyy") & (Format(Now, "MM") & Format(Now, "dd")))
http://msconline.maconstate.edu/tutorials/VBNET/VBNET01/vbnet01
|
|
|
|
|
You can actually get that in one step:
How about this:
Dim currTime as DateTime = DateTime.Now
MessageBox.Show(String.Format("{0:yyyyMMdd}", currTime)
Alternatively:
MessageBox.Show(currTime.ToString("yyyyMMdd"))
No need to go the route you've chosen above.
------------
Cheers,
Patrick
|
|
|
|
|
I need to make a quick RSS Reader. Can anyone help me with code or where to get the code I would greatly appreciate it.
|
|
|
|
|
pronk4prez,
Try reading this article[^] on creating a RSS Reader.
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
Hi,
Have an look on this Reader.
Hook Reader
Download the Rss reader. It's really nice one. You can have an look on it and get some ideas
Know is Drop, Unknown is Ocean
|
|
|
|
|
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Clrtest\Clrtest\Test Scripts\mFunctions.vb(904) : warning BC42016: Implicit conversion from 'Object' to 'Date'.
Clrtest -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Clrtest\Clrtest\bin\Clrtest.dll
Error: Column, parameter, or variable #1: Cannot find data type GL_Record.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Public Class GL_Record
Public AccountNo As String = ""
Public AccountField As String = ""
Public Year As Integer = 0
Public Month As Integer = 0
Public YTD As Decimal = 0
Public MTD As Decimal = 0
Public LastTransAmount As Decimal
Public LastTransDate As Date = "01/01/01"
Public LastTransBy As String = ""
Public LastEffectiveDate As Date = "01/01/01"
Public NumberOfTrans As Long = 0
End Class
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub sbSetupGLProbe(ByVal Selections As StoredProcedures.GL_Record)
Dim stDocName As String
Dim result As Long = 0
Try
sbBuildGLQuery(Selections)
stDocName = "rptGL_Probe"
Catch
fnHandleError("sbSetupGLProbe")
End Try
Exit Sub
End Sub
Help!!
|
|
|
|
|
Need to display current time on form in vb.net
|
|
|
|
|
Using a label do
<br />
Label1.Text = System.DateTime.Now<br />
To use different formats look up Formatting Date Time Values in .Net
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
What is a label do?
Do a create a label or textbox?
|
|
|
|
|
If you cannot understand this answer, you should buy a book on VB.NET and work through it, so you learn the language before you start playing with the IDE.
He's saying use a label and do what the code sample is showing you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian,
A lot big ideas; however, I didn't see you jump in and answer the so called "easy question".
Maybe you need to pickup the book yourself instead firing off sarcasm.
|
|
|
|
|
cwoods56,
A label[^] is a control you drag and drop onto your form. Chris wasn't being sarcastic, he was simply stating that my answer was in its most basic form and if you dont know what a label is you truly need to read about VB.Net before asking questions (as knowing the controls is the very primitive basics of working with VB.Net)
|
|
|
|
|
First of all, I apologise that for 40 odd minutes, I wasn't watching the VB forum to answer your question. It had been answered when I saw it, or I would have done.
Second, my suggestion is genuine, too many people here are asking questions that indicate they've taken no time to learn the basics, and such people are unlikely to ever get far.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I need to export my product table to an CSV and Excel file. All the products need to be in the CSV and Excel file. I have never worked with CSV and Excel.
Can someone maybe give me an indication of what the structure of such a file might look like, and how do I export it? If anyone has any good links that I can read, please let me know. The file must be later be imported back into the products table.
Regards
ma se
|
|
|
|
|
CSV files are nothing but (C)omma (S)eperated (V)alues which you can edit in Excel application.
It is so simple to export a table to CSV file format. Read your table into a DataSet/DataReader.
create a text file with extenstion .csv using FileStream and write all your column values as comma seprated values..
Cheers,
Suresh
|
|
|
|
|
When creating methods that use GUID values as parameters, is it best to be passing type GUID, type String, or should I be creating a method for both?
Examples
1.
Public Sub New(id As Guid)
_id=id
End
Or
2.
Public Sub New(id As String)
_id=New Guid(id)
End
Or
3.
Public Sub New(id As String)
Me.New(New Guid(id))
End Sub
Public Sub New(id As Guid)
_id=id
End
Thanks in advance!
john miller
web developer
|
|
|
|
|
Probably number 3 since it gives you the greatest flexibility. It couldn't hurt in any case, but you might want to double check the value comming in as string and throw an exception if the format fails or if the Guide creation fails.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks for the feedback! I'm already validating the format, but I cut the code out for sake of the example. Much appreciated.
john miller
web developer
|
|
|
|
|
In my use of GUID's I always pass them as strings. It just makes life easier. Including the datatype I give them in the sql database. I am sure some would disagree with the approch, but it has worked well for me.
Ben
|
|
|
|
|
hi there,
i am working on a project that deals with access database. i need to convert .sql file to access file. unfortunetly i do not know sql queries. is there a program that converts .sql files to .mdb file or if someone has the code can u give it to me please.
signing off is preci
|
|
|
|
|
No, there isn't. An .SQL file is usually just a bunch of SQL statements that get executed by an SQL server against a database. Access doesn't know what to do with one of these files, and frankly, you're going to have a tough time getting this conversion to work. Access only understands a subset of SQL, not the entire TSQL language. If this SQL file isn't made specifically for an Access database, you're wasting your time making a conversion utility.
More than likely, that file is used for building an SQL Server database, for which there is the osql utility to execute the commands in the file.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi all,
I need a code to Dial a Phone Number using Visual Basic.I want to know what are the reuirements for this (libraries).This is very Urgent.
Thak U,
Rajeshwar
|
|
|
|
|
raju_reddy wrote: I need a code to Dial a Phone Number using Visual Basic.I want to know what are the reuirements for this (libraries).
This is entirely dependant on the ahrdware you have and what port it's connected to. Usually, this would require at least a modem connected to a serial port, so, Google for "VB6 serial comm" and you'll come up with all kinds of examples for serial communication. The command you send to the modem will probably be something like "ATDTphonenumber", but the exact format and options would be covered in the manual for the modem.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|