|
Nevermind on the format, I think I figured it out.
|
|
|
|
|
ymilan wrote: I think I figured it out
Good for you well done.
For future reference, on the formatting thing there are two options
1. Type <pre> on the line above your code, and </pre> on the line after.
2. Next time tou post a message look just below the typing area, on the line above the emoticons, see the
code block , well either click on it first (it puts the tags in for you) then paste your code between the tags, or paste your code, select it all then click the code block widget.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I am trying to use an insert into command, but getting error in insert statement. Can anybody please tell me whats wrong with following code:
Dim cmd As OleDbCommand = New OleDbCommand("INSERT INTO [Joint Coordinates](Joint, CoordSys, CoordType, XorR, Y, Z, SpecialJt, GlobalX, GlobalY, GlobalZ, GUID) Values('" & dgr1.Cells(0).Value & "','" & dgr1.Cells(1).Value & "', '" & dgr1.Cells(2).Value & "', '" & dgr1.Cells(3).Value & "', '" & dgr1.Cells(4).Value & "', '" & dgr1.Cells(5).Value & "', '" & dgr1.Cells(6).Value & "', '" & dgr1.Cells(7).Value & "', '" & dgr1.Cells(8).Value & "', '" & dgr1.Cells(9).Value & "', '" & dgr1.Cells(10).Value & "')", con)
|
|
|
|
|
Maybe it's because the last parameter is expecting a GUID and you're supplying a string? Obviously I could be wrong but worth looking at
|
|
|
|
|
Rewrite this to use a parameterized query instead of the unsupportable monstrosity this is and it would be easier to fix.
Google results for "parameterized query[^]".
|
|
|
|
|
|
Hi,
I have a datagridview, and it's column(3) contains datetime field from datatable, selected from SQL-Query.
I want to set the culture info as "en-GB" to that date field.
is it possible? I tried by
dim dtbf_52 as new datatable, secidexp As New DataGridViewTextBoxColumn
ci = New System.Globalization.CultureInfo("en-GB")
dtbf_52.Locale = ci
Mydatagrid1.DataSource = dsf_52.Tables(0).DefaultView
With secidexp
.MaxInputLength = 10
.DataPropertyName = "sec_id_expiry"
.HeaderText = "ID EXPIRY DATE"
End With
but it's not getting the dd/MM/yyyy format for date field. So, How To set the culture info to this field?
Thanks Again
|
|
|
|
|
I don't know if this is of any help in your situation, but I have just been reading the MSDN documentation for DateTime again, for something of my own. Anyway, are you aware that the DateTime structure now has a Kind property (DateTimeKind enumeration) which can force it to LocalTime, amongst others.
I haven't finished reading all of it yet, but perhaps you might want to have a look for yourself.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi can anybody give me the vb.net code to send the aspx page content to a particular email id on submit
thanks
giri
|
|
|
|
|
|
you found the right forum, although you shouted there, so why cross post ?
We tend to give more help to people who show signs of trying to help themselves.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hello,
I'd like to know if there is an easy way to subtract two times, e.g:
HH:MM:SS,DDD
00:00:53,040
00:00:48,600
____________ -
??:??:??,???
I am now splitting the times (.split(":") ), putting the values back together as one decimal number, subtracting, and placing the ":"'s back (which is the hardest part). Now there must be an easier way to do this, but I don't know how. Somebody please help me out on this one?
Thanks in advance,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
DateTime, Parse, Subtract
|
|
|
|
|
Use the time span class TimeSpan instead of DateTime
Natza Mitzi
|
|
|
|
|
Natza Mitzi wrote: Use the time span class TimeSpan instead of DateTime
And how exactly would that help the OP where Lucs answer wouldn't?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Not true. You still have to use the DateTime class and the RESULT of the Subtract would be a TimeSpan.
|
|
|
|
|
Yes, that's true. Thanks all for your reply, I will try this tomorrow. Always nice to know that there are people willing to help you out!
Motivation is the key to software development.
|
|
|
|
|
Whenever calculating time I like to see it as a time span and not a date, I find it cleaner logically and its a safer when negative values might be present (they always come when you least expect it). When using a TimeSpan you convert twice and test for negative values once...
Natza Mitzi
|
|
|
|
|
when i tried using a few api functions like FindWindow
they didn't work for me
no error was produced in the debug mode(ie i ran using F5)
how is that??
is there a new way to use api in vb 2008
cause in older vb it is working??
TheMrProgrammer
|
|
|
|
|
Ya, using api in .net is different from VB 6.0. In VB 6.0 we often uses api call but in .net. Here is an example,
<DllImport("KERNEL32.DLL", EntryPoint:="GetSystemDirectoryW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Function GetSystemDirectory(ByVal Buffer _
As StringBuilder, ByVal Size As Integer) As Long
' Leave function empty - DLLImport attribute
' forces calls to GetSystemDirectory to
' be forwarded to GetSystemDirectory in KERNEL32.DLL
End Function
Please use google for futher clarification.
|
|
|
|
|
The process is known as PInvoke or P/Invoke.
If you search MSDN, or Google on those terms you will get lots of examples.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
The program I am writing now needs to send data through the serial port automatically. So far, I have been able to put it into a queue list and send it out using a timer. The problem is, the data sent is in two parts and must come consecutively after each part. After that, the timer kicks in and send another two part data.
Does anyone have any ideas on how to do it?
|
|
|
|
|
Your description isn't very clear. How to do what?? Send the data? It sounds like you already have that part down. Use a Timer? Look into System.Threading.Timer[^].
|
|
|
|
|
Hmmmm, the main idea is to queue a list of test to send through the serialport. I have got it down with a timer and queue list. The problem is the test themselves. Each test has a function that calls the device connected to the serial port. However, the functions itself is in two parts. I need to send it one after the other.
For example, (Test 1,2,3,etc) -> queue them -> send through serialport.
But each test, e.g Test 1 - function "a" and function "b" needs to be sent consecutively.
Anyh ideas on how to work around it? I tried putting it into an array and sending it out as an array but the device can't process the information fast enough. I need at least a 2sec delay.
|
|
|
|
|
I don't know how you designed the code, the quick'n'dirty method to pacing something like this at a 2 second interval would be Thread.Sleep(2000).
Normally, I'd probably build a component that handles it's own queue and keeps not only the message that should be sent, but with it, a delay time for how long until the item should be sent. Pop the item off the queue, check it's delay time and setup a Threading.Timer with the delay value and return. The Timer callback will call your code that sends the data to the device.
|
|
|
|