|
If you are updating the record through SQL command then use format(date,"yyyy-mm-dd").
Hope this will help.
Ejaz
|
|
|
|
|
if your program is in visual basic .net then following statement may solve your problem
date.ParseExact(DateStringFromUser,"dd/mm/yy" ,new system.Globalization.DateTimeFormatInfo).ToString("mm/dd/yyyy")
Salman Sheikh
|
|
|
|
|
Hi sheikh,
Thank you for your response.
While I debug the application, it is showing "String was not recognized as a
valid DateTime"
Please advise me
Ahamed Azeem
Software Programmer
Saudi Postal Technologies – Riyadh
|
|
|
|
|
date.ParseExact(DateStringFromUser,"dd/mm/yy" ,new system.Globalization.DateTimeFormatInfo).ToString("mm/dd/yyyy")
here date from user is the string user enters and the next argument is the format of the string entered by user
i.e if user enters
"03/08/2007" then the format is "dd/MM/yyyy"
and the argument in ToString method is the format you require to use
Salman Sheikh
|
|
|
|
|
Hello Friends,
I want to write a prg., which will have a Rich Text Box. User can enter & format text. Can be saved in a RFT file. I know all that stuff. My point is, user will open a rtf file, select customers to send the letter to. I got to merge the letter and the addressed of the customers and the user can print Page wise. Can I save it in a new rtf or doc file? I want similar output as we do in Word.
Is this kind of application possible! If I let this application make from some one, how much should it cost (Just to make my work easy, want to know)?
I want to make it, how do I make it. Any guidlines, reference, help is highly appreciative.
Thanks
Terry
|
|
|
|
|
Hi
In my application i am downloading mail from server for that purpose
i am using indy socket liabery and pop3 protocol.while downloading mail
if the mail body contain html tag (if it contain html table) then while
saving mail body to database it saves mail with all html code like
<doc type:="" w3...=""><htm> like that it uses all html tag i want to
save only text not the tag how can i do this.Currently i am doing as
If (xMsg.MessageParts(x).ContentType = "text/html") Then<br />
body = CType(xMsg.MessageParts.Items(x), Indy.Sockets.Text).Body.GetText()<br />
End if
if the mail contain html table and i checked with
type=xMsg.MessageParts(x).ContentType then is type variable
shows text/plain format and if i checked with
Dim s As String = xMsg.ContentType then it shows correct
"text/html" format. I i want to avoid html tag from body then how can i
do this.
Thanks.
Rahul
|
|
|
|
|
Hi,
I have been receiving this error to a program im developing and I cant figure out what it is.
Can anyone help me its urgent.
I have added a new sheet on an xlt file and add it to the code which is:
Public Sub Survey_1(ByVal report As String)
Dim stored_func() As String = { _
"[Production charts - Survey_1 - Export prices]", _
"[Production charts - Survey_1 - Export Price increase]", _
"[Production charts - Survey_1 - Export Price decrease]", _ <-- this one
"[Production charts - Survey_1 - Price increase by product]", _
"[Production charts - Survey_1 - Price increase by location]", _
"[Production charts - Survey_1 - Capacity]", _
"[Production charts - Survey_1 - Capacity expansion]"}
CreateReport(stored_func, report)
End Sub
Im getting the error on this side of the code:
Dim db1 As New DbTier
db1.DbSource = GetSetting("Server", "Data Source", "CSR", "")
db1.OpenConnection()
Dim i As Integer
Dim wb As Workbook = mvarExcel.Workbooks.Open(mvarTemplate)
Dim ws As Worksheet
Dim rg As Excel.Range
Dim drd As OleDb.OleDbDataReader
For i = LBound(stored_func) To UBound(stored_func)
ws = wb.Worksheets(i + 1)
rg = ws.Range("DATA" & i + 1) < ---- bug here
rg.ClearContents()
If i = 0 Then ws.Range("csr_title").Value = mvarCsrDetails(CsrIndex.Title)
drd = GetDataReader(db1, stored_func(i), mvarCsrDetails(CsrIndex.ID))
Dim r As Integer = 0
Dim c As Integer
While (drd.Read())
r += 1
For c = 0 To drd.FieldCount - 1
rg.Cells(r, c + 1) = drd(c)
RaiseEvent OnAfterEachProcess(stored_func(i))
Next c
End While
Call AdjustRange(ws, "COL1S" & i + 1, False)
Call AdjustRange(ws, "COL2S" & i + 1, True)
drd.Close()
Next
drd = Nothing
db1.CloseConnection()
db1 = Nothing
RaiseEvent OnAfterProcessDone("Saving " & report & ".")
Dim fleOutput As String = mvarOutputPath & UCase(mvarCsrDetails(CsrIndex.Title)) & " " & report & ".xls"
If File.Exists(fleOutput) Then File.Delete(fleOutput)
wb.SaveAs(fleOutput)
wb.Close(False)
the error says:
system.runtime.interopservices.COMException' occured in server2.2.exe
additional information: Exception from HRESULT: 0x800A03EC
|
|
|
|
|
dienadel wrote: its urgent
That is not nice around here. It'll just piss people off.
As far as the error is concerned, Exception from HRESULT: 0x800A03EC , those are notorious for not being very descriptive. Check that you don't have old processes running from previous debug sessions, and also make sure the parameters are called correctly. MSDN can be of more help...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello,
anybody with help on how to get the ip addresses or names of computers on an LAN.I tried using the directory services but doesnt work and the netview thing also kinda doesnt work, anybody with help?Thanks
phatkin
|
|
|
|
|
You can use the winshock control.
btn_click
Text1.Text = Winsock1.LocalIP
end sub
|
|
|
|
|
thanks nepalpawn am trying that out but i hope it supports other computers too on the network thanks soo much
am happy
phatkin
|
|
|
|
|
is the winsock a com control that i will add?
phatkin
|
|
|
|
|
Yes that is com control(.ocx).
|
|
|
|
|
hello frnd,
what u use vb.Net or VB 6.0 ???
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
i use vb.net 2005.Thanks
phatkin
|
|
|
|
|
it's easy then
just call shell("ipconfig" > "C:\ip.txt")
it will create the text file at location C:\ip.txt
it contains the ip and other things too.
read it and get information
and to get the computer name
just use
my.computer.name
regards,
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Thanks to ya'all.Thanks so much.
this is a real post
am happpy
phatkin
|
|
|
|
|
the code doesnt work it says "file not found"
any help?is it some text formatting tn i need to do?
phatkin
|
|
|
|
|
koolprasad2003 wrote:
just call shell("ipconfig" > "C:\ip.txt")
it will create the text file at location C:\ip.txt
it contains the ip and other things too.
read it and get information
The real question is, would you do that in your project?? Would you create a text file each time and read from it every time you want the ip address? I'd bet that no customer would accept such a solution.
SG
|
|
|
|
|
Can u help GS? PLZ?
phatkin
|
|
|
|
|
WMI [^]is a good option.
This[^] may also help.
SG
|
|
|
|
|
Thanks...would work that out
Actually am working on a chat application in vb.net where it is asynchrounous and that each macine is act as a server and client and i wanted a way of displaying all computers on an LAN.
phatkin
|
|
|
|
|
|
no not ip messenger. this is smaller than that one fo ra project.
am trying to use shell cmd net view to get the computers and use a text file cos i can see my way around the rest but the storing to the text file gives me problems says file not found
phatkin
|
|
|
|
|
ERROR:Format() is a type and cannot be used as an expression
Why is it this function works smoothly in VB.NET 2003?
Format(1234, "0000")
but when i try to used it in Visual Basic 2005
an error occurs just like this...
'Format' is a type and cannot be used as an expression
here's my code:
****************************************
Function AutoGenerateEmpID(ByVal strSQL As String) As String
Try
Dim strID As String
Dim strCharYr As String
Dim strDigit As String
openDB() 'this is just my customized function..
dbRecordset.Open(strSQL, dbConnection)
strDigit = Format(Val(dbRecordset.Fields("IDNo").Value) + 1, "0000") 'my error occurs here...
strCharYr = Microsoft.VisualBasic.Right(Year(Now), 2)
strID = strCharYr & "-" & strDigit
'dbRecordset.Fields(0).Value
closeDB() 'this is just my customized function..
Return strID
Catch ex As Exception
MsgBox(ex.ToString())
End Try
End Function
***************************
Note: expect that dbRecordset.Fields("IDNo").Value returns an numbers which is in the form of string
***********************************
Please help....
I cant figure it out my self why is that so??
Is it there something i just forgot to imports some namespace or what??
Please help...
Thanks in advance!!
|
|
|
|