|
How to convert in vb.net a '07' hexa value to '00000111' bit sequence?
|
|
|
|
|
|
hi,
Everyone know how to create the daily employees OverTime hour report in listview which mean the listview must included with some columns eg: Name, Age, Day1, Day2....... Day31!
So, the output is something like this:
Name Month Day1 Day2 Day3 ........ Day31
Steven Dec 1hour 2hour 0.5hour 1 hour
Marry Dec 5hour 1hour 2 hour 3 hour
. . . . . .
. . . . . .
So, i want create a new application which using the vb.net with m.access and the output record is look something like the "calendar" but it is using the "listview " to list the everyday record data for each employee!
Please help!!!
charleslau2855
|
|
|
|
|
I having a weird problem now... all the function run correctly, but the msgboc just didnt show out... it may make my user confuse is the function been run or not.
when i test it the function just run correct, save item if there is no record of it which mean Add new record, if there is record in it then dont perform anything.
Do
On Error Resume Next
temp = rs![custNO]
rs.MoveNext
Loop Until (rs.EOF)
If ccustno.Text <> rs![custNO] Then
rs.AddNew 'Add detail to record
rs.Fields("CustNo") = ccustno.Text
rs.Fields("Customer") = UCase(ccus.Text)
rs.Fields("Area") = UCase(carea.Text)
rs.Fields("Address") = UCase(caddress.Text)
rs.Fields("Tel") = cphone.Text
rs.Fields("Fax") = cfax.Text
rs.Fields("Name") = UCase(cattn.Text)
rs.update 'update u record
rs.MoveFirst
MsgBox ("Customer Information Recorded")
Else: MsgBox ("Customer already been create, please use the UPDATE function for update"): Exit Sub
End If
---
i have edit the code, it works well now
'move the return the database at first data if not it will have no current record error
'using DO loop to set the value to temp then compare it again and perform action with another ifelse outside the loop.
rs.MoveFirst <br />
Do<br />
If ccustno.Text <> rs![custno] Then<br />
ElseIf ccustno.Text = rs![custno] Then<br />
temp = rs![custno]<br />
End If<br />
rs.MoveNext<br />
Loop Until (rs.EOF)
<br />
If ccustno.Text <> temp Then<br />
....
-- modified at 22:52 Tuesday 5th September, 2006
|
|
|
|
|
You are mistaken, the function doesn't run correctly at all.
When you exit the loop the recordset will always be read to the end, so when you try to use rs![custNO] , you will get an error as you can not read anything from the recordset beyond the last record.
You are using On Error Resume Next, but you are not checking for errors anywhere, which means that you silently ignore anything that goes wrong.
---
b { font-weight: normal; }
|
|
|
|
|
ok now i have cancel the on error resume
I having error on handle my error control, when user try to save a new data which alreayd been create in database then i will show an error msg out with IF -ELSE but i not sure y the error keep pop out ask me to debug as it said there is duplication in the database.
I have already put the If else statment to control it ....but not really work...
If ccustno.Text <> rs![custno] Then
rs.AddNew 'Add detail to record
rs.Fields("CustNo") = ccustno.Text
rs.Fields("Customer") = UCase(ccus.Text)
rs.Fields("Area") = UCase(carea.Text)
rs.Fields("Address") = UCase(caddress.Text)
rs.Fields("Tel") = cphone.Text
rs.Fields("Fax") = cfax.Text
rs.Fields("Name") = UCase(cattn.Text)
rs.update 'update u record ------->highlight ERROR
rs.MoveFirst
MsgBox ("Customer Information Recorded")
ElseIf ccustno.Text = rs![custno] Then
MsgBox ("Customer already been create, please use the UPDATE function for update")
Exit Sub
End If
|
|
|
|
|
when user try to save a new data which alreayd been create in database then i will show an error msg out with IF -ELSE
What code do you use to make that check?
campbells wrote: but i not sure y the error keep pop out ask me to debug as it said there is duplication in the database.
The reason is very simple. You get the error message for the reason that is clearly stated in the error message. You are trying to create a duplicate in the database.
---
b { font-weight: normal; }
|
|
|
|
|
When i put the "on error resume next" my function work well REcently i just use that for temporary atleast my function work well.., cause i see the result myself. When user save something that already been save it will not save any change, if the record no exist then Add the new record. But the problem here is it always pop up the msgbox that record been save even when the record didnt save at all. suppose it have to pop up the other msgbox about the data didnt save in my elseif statement ccustno.Text = rs![custno].
|
|
|
|
|
campbells wrote: When i put the "on error resume next" my function work well
It only works well as long as there is no error. If there is an error, it doesn't work, but you don't notice it. At least not until later...
When user save something that already been save it will not save any change
That is because you are ignoring the error. Handling errors by ignoring them is not a good way to handle them. That is like turning the radio up when the car starts to sound funny...
But the problem here is it always pop up the msgbox that record been save even when the record didnt save at all.
That is because you ignore the error.
---
b { font-weight: normal; }
|
|
|
|
|
This just doesn’t make any sense what so ever.
[Warning This is Pseudo Code!]
Why not do a
Select Count(CustNo) as CountOfCustNo from Table where CustNo = ccustno.Text
[The above sql query doesn’t protect again SQL injection attacks.]
Then you can just do a simple
Int iCount
iCount = rs.Fields("CountOfCustNo”).Value
if iCount > 0 then
Msgbox “Customer Number in use”
Else
Update the record
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
campbells wrote: MsgBox ("Customer Information Recorded")
Try using Messagebox.Show("Blablabla")
|
|
|
|
|
Yes, that works, but I have seldom seen it done in such an inefficient way...
Instead of looping throught the entire recordset, select the record you are interrested in. Then you just have to check if the recordset is empty or not.
---
b { font-weight: normal; }
|
|
|
|
|
yes! thanks for telling me... i just edit it ,it almost like my search function .... more easy way... anyway having good experience :P
Dim recselect As Recordset
Dim sql
sql = "select *from Customer where [custno]=" & "'" & ccustno.Text & "'"
'On Error Resume Next
Set recselect = DB.OpenRecordset(sql, dbOpenSnapshot)
If recselect.RecordCount = 0 Then
rs.AddNew 'Add detail to record
rs.Fields("CustNo") = ccustno.Text
rs.Fields("Customer") = UCase(ccus.Text)
rs.Fields("Area") = UCase(carea.Text)
rs.Fields("Address") = UCase(caddress.Text)
rs.Fields("Tel") = cphone.Text
rs.Fields("Fax") = cfax.Text
rs.Fields("Name") = UCase(cattn.Text)
rs.update 'update u record
rs.MoveFirst
MsgBox ("Customer data saved")
Else
MsgBox ("Customer already been create, please use the UPDATE function for update")
End If
BUT will this cause SQL injection attack??
-- modified at 2:36 Wednesday 6th September, 2006
|
|
|
|
|
How can I incorporate the component of the .NET which related to crystal report in the setup along with the project so that it will be automatically installed these component at the time of installation of my project?
MNG
|
|
|
|
|
Hi
Try this pdf. It gives a complete info on how to deploy and after deploy problems
http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deployment.pdf
Hope this helps
Kanniah
|
|
|
|
|
The URL http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deployment.pdf
does not work. If one backs up to the .../CommunityCS/ level one finds out that only content authors and managers can view anything.
Charles Wolfe
C. Wolfe Software Engineering
|
|
|
|
|
Hi,
I am wondering if I can have a drop down list launching a sub without autopostback on?
I need it to populate another DDL when an item is selected...
The reason I want it to happen without autopostback on, is, I have so many many active items on page it takes forever to populate the second drop down list, and redisplay a datagrid...
Unacceptable, takes way too long...
So, in short: how to launch a sub from the DDL when selected index changed, without autopostback on (or if you have another suggestion on how to prevent whole page to reload)
NNM
|
|
|
|
|
use AJAX methos.
Softy Boy
|
|
|
|
|
thx for reply,
I'll have to look more at that ajax thing..
But for now, is there no asp element i can put the grid (and other panels/controls) in to prevent it from "blinking" every time a value in my drop down lists changes?
Or no vb.net solution to preventing this, and really have control over what happens on a selectedindexchanged..?
|
|
|
|
|
ii_noname_ii wrote: is there no asp element i can put the grid (and other panels/controls) in to prevent it from "blinking" every time a value in my drop down lists changes?
Not an official release version but you could try using the UpdatePanel component in the latest Atlas[^] CTP (which would be implementing Alax style controls).
Bear in mind that because the Atlas stuff is still pre-release it may be buggy & you shouldn't use it for any mission critical solutions. Apart from that i think the license agreement only runs till September 2007 (i'm open to correction there).
You could try doing it via client side scripts but that would probably be ridiculous.
|
|
|
|
|
A client side script launching a server side vb sub (which would then populate the next DDL)? that possible? (don't think so, but it would be nice...)
I guess I'm gonna look at that atlas thing, I failed to install/get it to work on my porject last time I tried it...
Still waiting if someone has a miracle solution like "just put your datagrid in <asp:[magicantipostback[> !"
|
|
|
|
|
ii_noname_ii wrote: A client side script launching a server side vb sub (which would then populate the next DDL)? that possible?
Yep, it is possible, but you'll still postback. The upside of ajax is that you're not posting the entire page back, just the bit that you need.
ii_noname_ii wrote: I failed to install/get it to work
I had a problem installing it on my machine at home as well but you can still make use of the tools when you reference the Microsoft.Web.Atlas.dll file. Remember to add the atlas tools to your toolbox as well - they're not automatically added when you reference the dll.
I've used the UpdatePanel from the atlas library more than anything else. It'll also be useful for you to download & watch the ToDo list sample application video[^] by Scott Gu.
|
|
|
|
|
It works!!!!
*champagne for everyone*
http://www.kynou.com/KYNOUControls.htm[^]
A very good tutorial.
Worked like a charm.
This is gonna make my webapp 100 times better...
(and I think Allmighty Mr.Microsoft (not being sarcastic, I really love MS :P) should really include this (or something similar) in .net as a standard option)
|
|
|
|
|
Running out of time for today, but will check here soon..
Seems once I've picked an item on drop down list nr.2 it won't repopulate after i change on nr.1 again..?
|
|
|
|
|
Although everything functions okay, I want to get rid of this warning (VS2005):
Warning: Type library exporter warning processing 'myCOMClass.FTPUtils.FTPdirectory, myCOMClass'.
Warning: Type library exporter encountered a type that derives from a generic class
and is not marked as [ClassInterface(ClassInterfaceType.None)].
Class interfaces cannot be exposed for such types.
Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and
exposing an explicit interface as the default interface to COM
using the ComDefaultInterface attribute.
I have create a COM Class with the following structure:
Imports System.Runtime.InteropServices
<Guid("AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE")> _
Public Interface ImyCOMClass
Function FTPUpload(ByVal localFileNameFull As String, ...) As Boolean
Function FTPDownload(ByVal localFileNameFull As String, ...) As Boolean
End Interface
<ClassInterface(ClassInterfaceType.None), _
Guid("FFFFFFFF-GGGG-HHHH-IIII-JJJJJJJJJJJJ")> _
Public Class myCOMClass
Implements ImyCOMClass
Public Function FTPUpload(ByVal localFileNameFull As String, ...) As Boolean _
Implements ImyCOMClass.FTPUpload
Return (New WebUtilities()).UploadFile(localFileNameFull, ...)
End Function
Public Function FTPDownload(ByVal localFilenameFull As String, ...) As Boolean _
Implements ImyCOMClass.FTPDownload
Return (New WebUtilities()).DownloadFile(localFilenameFull, ...)
End Function
End Class
I added ftpclient.vb which you can find at http://www.codeproject.com/vb/net/FtpClient.asp to my project.
So the structure is:
myCOMClass.FTPUpload -> WebUtilities.UploadFile -> New FTPUtils.FTPclient().Upload
The above mentioned warning is caused by the following definition in ftpclient.vb:
Public Class FTPdirectory
Inherits List(Of FTPfileInfo)
Some suggestions?
|
|
|
|