|
Can you paste your code here? might be easy to help you that way.
Difficult - > Challenging, this simple replacement made me take my life little easy;)
|
|
|
|
|
str="INSERT INTO tblHistoryLog(UserId,UserAction,TableName,ActionDate,TrDoneOn) VALUES('" + CheckValues.strUserId + "','NEW RECORD','USER TABLE','" + DateTime.Now + "','" + cmbTAUserId.Text + "')";
where ActionDate datatype if datetime.
i had inserted record in the table and inserted properly.
the query that uses the comparison
"SELECT * FROM tblHistoryLog WHERE (ActionDate BETWEEN #"+ dtpTo.Value +"# AND #"+ dtpFrom.Value +"#)"
but it gives the no result
i had tried to use this but it does not compile so i had to use above
"+ #dtpTo.Value# +" AND "+ #dtpFrom.Value# +"
Tasleem Arif
|
|
|
|
|
What database are you using?
What is the data type of the field in the database?
---
b { font-weight: normal; }
-- modified at 8:07 Saturday 8th July, 2006
|
|
|
|
|
datatype is datetime and i m using sql server2000
Tasleem Arif
|
|
|
|
|
Then you shouldn't use # arounds the date values. That is use with MS Access.
---
b { font-weight: normal; }
|
|
|
|
|
I assume that you are using either ASP.NET or windows forms as client. Try following:
"ActionDate BETWEEN" & " '" & Convert.ToDateTime(dtpFrom.Value).ToLongDateString & "' AND " & " '" & Convert.ToDateTime(dtpTo.Text).ToLongDateString & "'"
I also notice in your code, you are going from To...From! usually it is From...To right?
Hope this helps.
Difficult - > Challenging, this simple replacement made me take my life little easy;)
|
|
|
|
|
Hi everybody,
I use the following code to download a file from the Inet:
<br />
Private myClient As WebClient<br />
<br />
Private sub Load_It<br />
<br />
MyClient = New WebClient()<br />
MyClient.DownloadFile(myURIStr, fileName)<br />
<br />
End sub
This takes about 30 to 35 secs to fail if it cannot stablish a connection. Since I wanted to be able to Cancel the download at will, I tried calling this method from a running thread; but after this, I get an inmediate connection error when I try to download the file again; which does not happend if a wait for it to fail when using it outside the thread.
Any helpful ideas?
thanks.
The same lost guy
-- modified at 10:01 Saturday 8th July, 2006
|
|
|
|
|
Hi everyone.
I have developed a crystal report of "Books" table and when I view it in crytal report viewer, it ask me about the server name, database name, user name and password.
Although the other default samples of Crytal Reports are running well... there is no any constraint of username and password in database and getting it easily in my .net application but having problem in crystal reports.
Kindly reply me. It is urgent.
Thank You
Syed Ali Raza Rizvi
|
|
|
|
|
i had the same problem, this is basically how i solved it.
use this code to generate your report -
<br />
Private Function SetDataSource _ <br />
(ByVal conn As String, ByVal query As String, _<br />
ByVal dataSet As DataSet)<br />
<br />
' create a new connection & data adapter object <br />
Dim oleConn As New OleDbConnection(conn)<br />
Dim oleAdapter As New OleDbDataAdapter()<br />
'pass your query to the data adapter<br />
oleAdapter.SelectCommand = New OleDbCommand(query, oleConn)<br />
<br />
' Connect to the data source, fetch the data, and disconnect <br />
' from the database.<br />
Try<br />
oleAdapter.Fill(dataSet, "Books")<br />
Catch ex as Exception<br />
Messagebox.Show(ex.InnerException.ToString)<br />
End Try<br />
<br />
' Pass the populated data set to the report.<br />
Report.SetDataSource(dataSet)<br />
<br />
' Set the report viewer to show the report (if you have<br />
' multiple reports for the same viewer and haven't set<br />
' the ReportSource property of the viewer)<br />
Form1.CrystalReportViewer1.ReportSource = Report<br />
<br />
End Function<br />
<br />
|
|
|
|
|
I am using this code to change text color of listview selected item. But it never works.Could an expert look at it and tell me what i am doing wrong. The hwnd is corect since the line :
[code=vb]lItemPos = 0& ' first item
SendMessage hwnd, LVM_SETITEMSTATE, lItemPos, ByVal lxprocLVITEM[/code]
is working perfectly and is selecing the zero position item for me and highlighting it corectly.
Some people suggest i need to send a refresh using LVM_REDRAWITEMS to listview after setting a color for it. But i do not know how to use LVM_REDRAWITEMS. I be happy if an expert help me fix there problems.Thanks
not working call to LVM_SETITEMSTATE
Private Const LVM_SETTEXTBKCOLOR = (LVM_FIRST + 38) <br />
<br />
lItemPos = 0& ' first item<br />
SendMessage hwnd, LVM_SETITEMSTATE, lItemPos, ByVal lxprocLVITEM<br />
<br />
'SendMessage hwnd, LVM_SETTEXTBKCOLOR, 0, hexdec(16711935)<br />
'SendMessage hwnd, LVM_SETTEXTBKCOLOR, 0, 16711935<br />
'SendMessage hwnd, LVM_SETTEXTBKCOLOR, 0&, 0&<br />
<br />
<br />
<br />
SendMessage hwnd, LVM_SETTEXTBKCOLOR, 0, 16711935<br />
<br />
-- modified at 12:20 Friday 7th July, 2006
|
|
|
|
|
Are you doing this so you can change that appearance of a listview in your own app or another one?? If your doing this in your own ass, you're going about it the hard way. search the articles for "ownerdraw listview" and you'll come up with a few good examples.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am doing this for external listview . I mean in another application that i do not have its source code!
|
|
|
|
|
OK. Well, the docs on the LVM_REDRAWITEMS[^] message are pretty straight forward. You already have the mechanism to send the message. All you need to do is supply the listviews first and last item numbers that need to be redrawn.
Now, you have a second, more serious problem, that you can't get around. If this was your own ListView and your were ownerdrawing it, your code would have to be written to specifically handle this message. I have yet to see an ownerdrawn ListView that does this. If the app your trying to control like this ownerdraws its ListView control, you're S.O.L, and none of this will ever matter.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
could u tell me what should i put for the parameters in my case :
SendMessage(
(HWND) hWndControl,
(UINT) LVM_SETTEXTCOLOR,
(WPARAM) wParam,
(LPARAM) lParam
<br />
);
I have no idea what should put and replace what ?
|
|
|
|
|
Don't tell me you copy-paste-and-prayed the code you posted??
LVM_REDRAWITEMS is (LVM_FIRST + 21)
The wParam value should be the index number of the first ListView item that needs to be redrawn. The lParam value should be the index of the last item.
So, you're code would be something like:
Private Const LVM_REDRAWITEMS = (LVM_FIRST + 21)
.
.
.
SendMessage hwnd, LVM_REDRAWITEMS, firstItemIndex, lastItemIndex
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It does not work !!!
SendMessage hwnd, LVM_REDRAWITEMS, 0, 12
|
|
|
|
|
Then it's entirely possible that the ListView you're trying to control is ownerdrawn by the other application. In which case, there's nothing you can do to get the effect you want. This is because the ownerdraw code will always paint the items exactly how its written to, ignoring the attributes that your injecting into the items list.
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 16:16 Friday 7th July, 2006
|
|
|
|
|
That is not true that the listview is overdrwan by diffrent application. Since i got visual c++ version of same code and it is corectly changing the color!! I think there is problem in calling refresh and redraw !
-- modified at 16:17 Friday 7th July, 2006
|
|
|
|
|
method007 wrote: is working perfectly and is selecing the zero position item for me and highlighting it corectly.
Some people suggest i need to send a refresh using LVM_REDRAWITEMS to listview after setting a color for it. But i do not know how to use LVM_REDRAWITEMS. I be happy if an expert help me fix there problems.Thanks
Then I'm failing to see what your problem is or what your intended effect is...
You're original post said the code is working, but in the next sentence, says that people are suggesting sending other messages. What's broken??
Are you saying that you have C++ code that is working, but when you try to convert it to VB.NET it isn't??
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 16:21 Friday 7th July, 2006
|
|
|
|
|
i mean i have visual c++ version of code and it is working but i try to convert it to visual basic 6 and it is not working. they suggest the redraw methond and non works!! It was mentiioned that some other application is sending redraw so that is why it is not working the give code and i said no because the visual c++ is working corectly
Now all i want to make this work . It is visual basic 6 code!
|
|
|
|
|
We'll have to see the C++ code you're using and the VB6 code came up with from it. There's obviously something missing...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Here is the visual c++ version :
void CColor1Dlg::OnButton1() <br />
{<br />
HWND hPalWnd = ::FindWindow("my window class", NULL);<br />
HWND spilterwindow = FindWindowEx(hPalWnd, 0, "WTL_SplitterWindow", 0);<br />
spilterwindow = FindWindowEx(spilterwindow, 0, "WTL_SplitterWindow", 0);<br />
HWND ATL = FindWindowEx(spilterwindow, 0, "WTL_SplitterWindow", 0);<br />
HWND ATLWIN = FindWindowEx(ATL, 0, "atl:0053c8d0", 0);<br />
HWND Dialog = FindWindowEx(ATLWIN, 0, "SysListView32", 0);<br />
HWND Rich = FindWindowEx(Dialog, 0, "SysHeader32", 0);<br />
<br />
<br />
<br />
CButton *pButton1 = (CButton*)GetDlgItem(IDC_BUTTON1);<br />
COLORREF GetBkColor(IDC_BUTTON1);<br />
<br />
COLORREF color = 33023;<br />
TRACE("Color of the selected font = %8x\n", color);<br />
<br />
::SendMessage(Dialog, LVM_SETTEXTCOLOR, 0, color);<br />
<br />
}
|
|
|
|
|
And the VB6 code???
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
i have two hashtables
example :
Hashtable 1 Hashtable 2
key Value key Value
Details Order Details Product
Can i get One Order from 1st hashtable and then One product from the second hashtable ?
Thanks
blue
|
|
|
|
|
If any one not understood my question
My Question is Incase if i have two hashTables and does not contain same key values , so there is no link between the two tables right.
Now i want to loop thru both the hashtables at a time
like one value from 1st hashtable and one value from the 2nd hashtable
then move next ....so on
Can i use for i as integer=0 to ht.count or something like that ??
blue
|
|
|
|