|
when I save date it save as for example 06:48 A.M
but i want it save such as 18:48
please help me
|
|
|
|
|
Tell me you are NOT saving your dates as strings (varchar()). A date should be saved as a DATETIME datatype, NEVER, EVER, EVER use text datatypes to save your dates.
If you store your date as Datetime then the format you DISPLAY the data is up to you, look at the datetime type.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
I am sending mail by using my application and Opening Text File.
So antivirus shows my application to Spyware. my confution is that outlook and other software also send mail but they are now showing in spyware category.
So how to create my application to antivirus avoider. Because my application is not working any wrong activity.
and when i try to open log file. Antivirus shows it trying to use shell execution command.
So please help me how to resolve it.
If you can think then I Can.
|
|
|
|
|
You have to change what your code is doing, what access it requests of files, where the files it reads live, etc, until you satisfy the anti spyware program that you're not doing anything wrong.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for reply,
But my second query is that why outlook not shows as Suspicious Activity performer. It also send mail.
If you can think then I Can.
|
|
|
|
|
Hi All,
I hope someone can asnwer this question?
Is it possible to resize the taskbar in xp using code?
I see many articles on hiding/showing the taskbar using SetWindowsPos
I have also tried using the SetWindowsPos to set its height with no susccess... hears what i got so far...
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
dim iCurW As Long, iCurH As Long
' lCurH already holds the current Height of the taskbar
' lCurW already holds the current Width of the taskbar
Private Sub cmdSet_Click()
Call SetWindowPos(TaskB, 0, 0, 0, iCurW, iCurH * 2, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE)
End Sub
I'm attempting to double the height of a single height taskbar any help would be appreciated.
|
|
|
|
|
This seems like a strange thing to want to do.
If it's your own system, simply alter the TaskBar height manually.
If it is somebody else's system, altering their settings is a bit rude. Some people take ages to get things just the way they like them, and then along comes some application and messes things up. That is the way to ensure they don't use your software ever.
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.”
|
|
|
|
|
How can i search a record from a table.
If found, display the record.
if not found display a message
I have done the following:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search.Click
Try
Me.RegistrationTableAdapter.FillByRegistration_(Me.RegisComplaintDataSet.Registration, Registration.Text)
If String.IsNullOrEmpty(Me.Registration.Text) Then
MsgBox("L'enregistrement n'existe pas" & UCase(Me.Registration.Text))
Me.Registration.Text = ""
Else
Me.Registration.Text = Me.Registration.Text
End If
Catch ex As Exception
End Try
End Sub
I am getting the result when it is found but no message when it is not
Thanks
|
|
|
|
|
Stick a breakpoint in your Catch block and see what error you're missing. I'd say it's probably coming back as a DBNull, and throwing an exception when you try to cast it into a string (Registration.Text).
You might have to put it in an object first, then check whether it's a DBNull (And display the message if so), and THEN cast it into a string if it exists.
|
|
|
|
|
Thanks,
I am not getting an error. when there is a match, I get the correct row record as the result..
when there is no match I get blank row record..
what i want is a message to display "no match for this" then a blank row.
I hope I make myself clear
thanks alot
|
|
|
|
|
Alright, well if you're absolutely sure it's not going into that Catch block (Notice that with an empty catch block, your program will just completely ignore any errors)...
If it's actually not triggering an error, then it's time to check the FillByRegistration_() function... Drop in some breakpoints and keep an eye on the values when you search for a non-matching record.
|
|
|
|
|
Thanks
I got the solution
|
|
|
|
|
Try using this in your "catch" block so see the error.
MsgBox(ex.ToString)
|
|
|
|
|
There is a table called QCR100 containing the following information
ITEM_CODE ITEM_DESCRIPTION DCODE AMOUNT
111200 investments 24000003 1630000000.0000
111200 investments 126000005 1630000000.0000
111600 Other Assets 133000009 1700000000.0000
111600 Other Assets 150000002 1730000000.0000
111701 Leasehold 190010130 1740000000.0000
111705 Furniture 190010036 1750000000.0000
111706 Computer Software 190010141 46995799.1800
Then I created a view with this command statement:
SELECT CASE WHEN LEFT(e.dcode, 1) = '1' THEN isnull(SUM(a.Dr_bal_lcy - a.CR_BAL_LCY), 0) WHEN LEFT(e.dcode, 1)
= '2' THEN isnull(SUM(a.CR_BAL_LCY - a.Dr_bal_lcy), 0) ELSE 0 END AS amount, e.ITEM_DESCRIPTION, e.ITEM_CODE
FROM dbo.GLTEMP_CONS AS a RIGHT OUTER JOIN
dbo.QCR100 AS e ON LTRIM(a.GL_code) = e.Dcode
GROUP BY e.ITEM_DESCRIPTION, e.ITEM_CODE, e.Dcode
How I can modify this view to sum the amount for any duplicated item code and group by item code
Example
ITEM_CODE ITEM_DESCRIPTION DCODE AMOUNT
111200 investments 24000003 1630000000.0000
111600 Other Assets 133000009 1700000000.0000
111701 Leasehold 190010130 1740000000.0000
111705 Furniture 190010036 1750000000.0000
111706 Computer Software 190010141 46995799.1800
|
|
|
|
|
This is really a SQL question, not a VB question and should probably belong in the General Database forum.
That said, I'm having a difficult time trying to figure out what you're asking. Is it that your view is doing one level of aggregation, and you need a second (grouping then by item code)? If so, you can use the query you have as a subquery, nested inside another that performs that second level of aggregation:
SELECT ITEM_CODE, SUM(...)
FROM
(
-- original query
SELECT CASE WHEN LEFT(e.dcode,1) = '1' THEN ...
...
) x
GROUP BY ITEM_CODE
|
|
|
|
|
hi,
I have a datagridview control to view the data from the database. The users want to use the keyboard to select a specific row/record by pressing the 'ENTER' key.
its nothing return anything..
Plz help me...
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Make sure that you got something in your database tables and secondly your query is bring something to show. Best thing would be to first try your query on Management Studio and then port it to VB code.
|
|
|
|
|
hi,
i got result...
easy way to select entire rows..
Go to Datagrid proerties one option is there.
ie. selection mode => select Full row select
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
I am designing an Urdu editor. Urdu language is written from right to left. I have implemented this by using rtb.SelectionAlignment = HorizontalAlignment.Right and using SendKeys.Send("{LEFT}") after every key user presses. I have not used the RightToLeft property of rtb because in that case the cursor remains at right side of rtb and as user presses keys the words move to left. Now I implemented justification using some code from net. I tried it on english editor, it works fine. But when I use it for my Urdu editor the cursor goes to left side of rtb and when I type smthg, words move to right side but cursor remains at left side. The code is here
Enum TextAlign
Left = 1
Right = 2
Center = 3
Justify = 4
End Enum
<DllImport("user32", CharSet:=CharSet.Auto)> _
Private Shared Function SendMessage(ByVal hWnd As HandleRef, _
ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
End Function
<DllImport("user32", CharSet:=CharSet.Auto)> _
Private Shared Function SendMessage(ByVal hWnd As HandleRef, _
ByVal msg As Integer, ByVal wParam As Integer, ByRef lp As PARAFORMAT) As Integer
End Function
<StructLayout(LayoutKind.Sequential)> _
Private Structure PARAFORMAT
Public cbSize As Integer
Public dwMask As UInteger
Public wNumbering As Short
Public wReserved As Short
Public dxStartIndent As Integer
Public dxRightIndent As Integer
Public dxOffset As Integer
Public wAlignment As Short
Public cTabCount As Short
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> _
Public rgxTabs() As Integer
' PARAFORMAT2 from here onwards.
Public dySpaceBefore As Int32
Public dySpaceAfter As Int32
Public dyLineSpacing As Int32
Public sStyle As Short
Public bLineSpacingRule As Byte
Public bOutlineLevel As Byte
Public wShadingWeight As Short
Public wShadingStyle As Short
Public wNumberingStart As Short
Public wNumberingStyle As Short
Public wNumberingTab As Short
Public wBorderSpace As Short
Public wBorderWidth As Short
Public wBorders As Short
End Structure
Private updating As Int32 = 0
Private oldEventMask As Int32 = 0
'Constants from the Platform SDK.
Private Const EM_SETEVENTMASK As Integer = 1073
Private Const EM_GETPARAFORMAT As Integer = 1085
Private Const EM_SETPARAFORMAT As Integer = 1095
Private Const EM_SETTYPOGRAPHYOPTIONS As Integer = 1226
Private Const WM_SETREDRAW As Integer = 11
Private Const TO_ADVANCEDTYPOGRAPHY As Integer = 1
Private Const PFM_ALIGNMENT As Integer = 8
Private Const SCF_SELECTION As Integer = 1
Protected Overrides Sub OnHandleCreated(ByVal e As EventArgs)
MyBase.OnHandleCreated(e)
'Enable support for justification.
SendMessage(New HandleRef(Me, Handle), _
EM_SETTYPOGRAPHYOPTIONS, _
TO_ADVANCEDTYPOGRAPHY, _
TO_ADVANCEDTYPOGRAPHY)
End Sub
Public Overloads Property SelectionAlignment() As TextAlign
Get
Dim fmt As PARAFORMAT = New PARAFORMAT()
fmt.cbSize = Marshal.SizeOf(fmt)
' Get the alignment.
SendMessage(New HandleRef(Me, Handle), _
EM_GETPARAFORMAT, _
SCF_SELECTION, fmt)
' Default to Left align.
If ((fmt.dwMask & PFM_ALIGNMENT) = 0) Then
Return TextAlign.Left
End If
If fmt.wAlignment = 1 Then
Return TextAlign.Left
ElseIf fmt.wAlignment = 2 Then
Return TextAlign.Right
ElseIf fmt.wAlignment = 3 Then
Return TextAlign.Center
ElseIf fmt.wAlignment Then
Return TextAlign.Justify
End If
End Get
Set(ByVal value As TextAlign)
Dim fmt As PARAFORMAT = New PARAFORMAT()
fmt.cbSize = Marshal.SizeOf(fmt)
fmt.dwMask = PFM_ALIGNMENT
fmt.wAlignment = CShort(value)
' Set the alignment.
SendMessage(New HandleRef(Me, Handle), _
EM_SETPARAFORMAT, _
SCF_SELECTION, fmt)
End Set
End Property
I tried with this change
If ((fmt.dwMask & PFM_ALIGNMENT) = 0) Then
Return TextAlign.Right
End If
But it doesn’t work. Can anyone plz tell me how to make it work for urdu language?
|
|
|
|
|
|
I checked it out but I need to change the code. In this code when I justify text, the text is justified from left to right. I want to change this code so that after justifying text retains its right alignment.
|
|
|
|
|
I've been landed with an existing spreadsheet that has a data connection that is used to import some data when it opens. Then they run a macro to organize the data and a few other bits. All is working well.
Now I need to write a macro to save a copy of this workbook, but without the data connection and the macros.
Any pointers welcome!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
So you just want to save the worksheet(s) data without any of the macros? Is that correct? And you want to do this with another macro or do you want to do this through .Net?
|
|
|
|
|
Yeah - and with the data connection removed.
Need to do it using VBA ideally.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Assuming the data and the macros are in different worksheets you should be able to use worksheet saveas in a macro. Look into the options on saveas. I have not written VBA for 15+ years so I may be wrong but I used to record a macro and examining the content to see what MS did.
Never underestimate the power of human stupidity
RAH
|
|
|
|