|
Hi,
Thanks alot for your reply, this seems to be exactly what I am looking for!! I also think the second method is whit seems to be appropriate in this situation.
|
|
|
|
|
welcome..
pallavi
|
|
|
|
|
Hi,
Soz to bother u again but you never told me what it is the getReportData does. I assume it gets the report using OLE, but how does one do that????
|
|
|
|
|
I want to enter data for the txtbox where it has to check some conditions like the first character. I had written the following code, but it is not working, can anyone tell what is the error?
If (Mid(Txtpno.Text, 1,1) <> "P") Or (Mid(Txtpno.Text, 1, 3) <> "oth" Or (Mid(Txtpno.Text, 1, 2) <> "PT") Or (Mid(Txtpno.Text, 1, 2) <> "st") Or (Mid(Txtpno.Text, 1, 2) <> "ac") Or (Mid(Txtpno.Text, 1, 2) <> "vl") Or (Mid(Txtpno.Text, 1, 2) <> "aP") Or (Mid(Txtpno.Text, 1, 2) <> "Tc")) Then
Lblmsg.Visible = True
Lblmsg.ForeColor = Drawing.Color.Red
Lblmsg.Text = "Invalid Pno!"
Exit Sub
End If
|
|
|
|
|
Hi
Firstly i would recommend moving the logic out of the form and into a class which could be used thoughout your application ensuring that the same business rule is followed consistently.
For readability i would also suggest working through as single rules which would then ensure that less processing would take place as the whole statement need not be parsed and the function would return as soon as an invalid pNo rule was reached.
Public Function ValidatePNo(ByVal pNo as string) as boolean
If pNo.startswith("p") then return false
if pNo.startswith("oth") then return false
..
Return True
End Function
|
|
|
|
|
Thank you. It is working.
Chaitra N
|
|
|
|
|
You've used "<>" together with "or". Be very careful.
Consider the following:
If (Mid(Txtpno.Text, 1,1) <> "P") or (Mid(Txtpno.Text, 1,1) <> "F") then
end if
What you're actually saying is that if the first letter doesn't equal P or the first letter doesn't equal F then do something.
What fulfills the criteria of not having a first letter equal to P or not having a first letter equal to F? Absolutely everything is the answer.
If you're trying to do what I think you're trying to do, then you want to use 'and' operators instead of 'or'. It is however exceedingly messy and confusing and you'd be much better off abstracting it into a separate function that checks validity against each parameter one by one.
|
|
|
|
|
I need to sort my datagrid,when user clicks any columnheader ,datagrid should be sorted on that column, I m using sortexpression and datagrid_sortcommand but don't know how to handel datagrid and e.sortexpression in datagrid_SortCommand method.
Plz guide me.
With Thanks & Regards
Amit Sk Sharma
|
|
|
|
|
See that have u made datagrid allow sorting property to true.
df
|
|
|
|
|
Hi,
I am using IFrame in my project (which I know some people might say frames are evil but I just don't know what best to replace it).
Let say FrameLeft and FrameRight, FrameLeft is a navigation area which will cause FrameRight to switch from one page to another. The problem is when I am not at my main page and I click Refresh button, it refresh and bring me back to my main page.
I found a way in HTML that it will refresh the same page last time but unfortunately due to hardware failure, I lost the codes.
So I really appreciate if anyone has any idea for this.
Thanks in advance.
J Liang
|
|
|
|
|
I would suggest moving away from IFrames and using DIV elements to layout your page. You can achieve the same look without all of the problems which the IFrames have caused.
A site called CSSPlay has a section on layouts which show some example page layouts and the relevent CSS and HTML needed to achieve the result
http://www.cssplay.co.uk/layouts/[^]
|
|
|
|
|
Hi Shatchard,
Thanks for the reply, been reading some articles about CSS. I was wondering whether CSS could do something like IFrame with the Tree View in the page without me including it in each of my web page. I never use CSS before, so I can't see how it can do this.
Thanks.
J Liang
|
|
|
|
|
Hi All,
I am trying to make a custom TextBox (MaskedTextBox) with some JavaScript generated formatting but are having some problems validating the control.
I have done the following; In an UserControl I have a TextBox with a JavaScript function added that does the formatting on the input.
TextBox1.Attributes.Add("onkeyup", "FormatValue(this, event)");
An other (hidden) TextBox contains the 'original' value of the first TextBox set with the a JavaScript function. So the 'raw' value'
I am hiding the 2ns TextBox with a added Style (display.none).
I would like to validate that value with a RangeValidator but it seems like the validator never 'see' the JavaScript generated value.
So for me it seems like teh validator only see text that have been entered directly in the TextBox and not if it is set with JavaScript. Is the right understod? And more important, can I do anything to make it see the JavaScript generated value.
Alvast bedankt
Mike
|
|
|
|
|
Ghehe, ook eindigen met 'Alvast Bedankt', vast weinig mensen die dat snappen
Have you tried setting the style for your hidden control to visible for testing purpose? Maybe the javascript generated value returns an incorrect value which the validator thinks is OK. You can also consider using the regexp validator which I think is more powerfull then the range validator. I only use the range validator to check if a number is within a valid range.
|
|
|
|
|
Thanks for the reply.
While testing both the TestBoxes are visible on the page.
For me it seems like the validator never 'sees' the JavaScript generated value in the 2nd TextBox.
Regards,
Mike
Mike
|
|
|
|
|
Found the problem...
I'd forgot to set the Type of the validator so it always returned false
Mike
Mike
|
|
|
|
|
cheers
|
|
|
|
|
i have an column check in access database which is of datatype yes/no
i need to update the state ie.. uncheck
the query below does not work it says error in update statment
update tbladvance set check=false where ecode='1011' and type='festival' and check=true
the above query executed in Ms-Access query works perfectly but not through the code
help me
-- modified at 4:47 Thursday 28th June, 2007
|
|
|
|
|
Without being an Access expert I do see something that looks a little odd in the code you posted.
<br />
update tbladvance <br />
set check = false<br />
and <br />
where <br />
ecode = '1011' <br />
and <br />
type = 'festival' <br />
and <br />
check = true<br />
Should probably be:
<br />
update tbladvance <br />
set check = false <br />
where <br />
ecode = '1011' <br />
and <br />
type = 'festival' <br />
and <br />
check = true<br />
So remove the 1st AND
Regards,
Mike
|
|
|
|
|
hi mike
sorry!.. And is not there... query written by u is the same query i execute.. but it doesnt exectute at all
|
|
|
|
|
update tbladvance set check=false where ecode='1011' and type='festival' and check=true
|
|
|
|
|
hi all,
i need a optimized solution for my problem.my situation arises such that i need to loop which internally calls lots of classes i.e including creating
object for that class. say
class c
{
for i=1 to 10000
{
create object for class a;
a.function1;
a.function2;
create object for class b;
b.function1;
b.function2;
}
}
class a
{
function 1
function 2
function 3
}
class b
{
function 1
function 2
}
so where should i create the object inside the loop or outside the loop. will creating object inside the loop kills the time or not?
|
|
|
|
|
raj_developer wrote: so where should i create the object
It Depends on wat are the function and how you want to use that object.
I think for performance improvement you should create a object outside.
Inside loop will create a object 10000.
|
|
|
|
|
Impossible to say because it depends on what you are doing with the objects.
Please give some more information about your intentions.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
hi guys,
thanks for your reply,
the approached i have shown is something similar to visual basic 6, i need to know whether is the right way to call a class inside a loop or is there any DOTNET way.
|
|
|
|