|
Thanks for ur answer.
but the above code will not work in .net.
I have tried already.
ok anyhow thnkss,any other idea(not with for or while etc)
kissy
|
|
|
|
|
Kissy16 wrote: How can i use break statement in a IF loop
IF is Not A Loop . It is a Statement !!!
Kissy16 wrote: if label1.text="yes"
break
else
''do something....
end if
this is similar to ....
if label1.text!= "yes"<br />
end if
cheers,
Abhijit
|
|
|
|
|
dear abhijeet,
thanks for ur advice.i know that is not a loop.
i just want to use break with If.
I know how to use with FOr or while etc.
My requirement is with If.
If not possible i will try with something.
kissy
|
|
|
|
|
Kissy16 wrote: My requirement is with If.
If not possible i will try with something
Not only is it not possible, it does not make sense. IF and BREAK are two totally unrelated commands. How would you expect to use BREAK (which exits a loop of some kind) in an IF statement, which is simply conditional?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Kissy16 wrote: If not possible i will try with something.
i have given you a solution , you can use that .
cheers,
Abhijit
|
|
|
|
|
r u using vb.net or c#.net
|
|
|
|
|
It makes no difference, IF and BREAK are not related. IF is a conditional statement, it is either true or false, so where would a break come in?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Kissy16 wrote: in a IF loop
IF's are not loops, they are just conditions Loops are things like while and for ...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi
how to add Click event for dynamic created LinkButton in server side coding.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Guess you need to do something like this.
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
LinkButton lnkButton = new LinkButton() { ID = "lnkButton" };
lnkButton.Click += new EventHandler(lnkButton_Click);
this.Page.Form.Controls.Add(lnkButton);
}
protected void lnkButton_Click(object sender, EventArgs e)
{
}
}
|
|
|
|
|
Hi
In the code block below, I am identifying distinct values for a member variable 'Age' of class Person from a list of persons List<Person> by looping. I wanted to know whether I can use a suitable delegate to accomplish the same without having to loop. See code comments.
Thanks
public partial class Default1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
List<Person> people = new List<Person>();
people.Add(new Person() { FirstName = "Gill", LastName = "Julian", Age = 20 });
people.Add(new Person() { FirstName = "Hill", LastName = "Andrew", Age = 19 });
people.Add(new Person() { FirstName = "Hart", LastName = "Brett", Age = 24 });
people.Add(new Person() { FirstName = "Dwight", LastName = "Jane", Age = 20 });
people.Add(new Person() { FirstName = "Gary", LastName = "Gray", Age = 18 });
people.Add(new Person() { FirstName = "Prim", LastName = "Anne", Age = 19 });
List<int> distinctAges = new List<int>();
foreach(Person person in people)
if(!distinctAges.Contains(person.Age))
distinctAges.Add(person.Age);
}
public class Person
{
public string FirstName;
public string LastName;
public int Age;
}
}
|
|
|
|
|
|
Unfortunately your link does not address my question in any way.
|
|
|
|
|
|
Where there is a will, there is a way.
When you declare a list (like List<Person>, in my example), you will need to add System.Collections.Generic namespace.
Now, if you also add System.Linq namespace, you will get a couple more methods to use with your list that you would not get if you just added System.Collections.Generic namespace. These methods will allow you to do more with your list. Hence, to find distinct values for member variables based on my example below, the following statement will suffice.
distinctAges = people.Select(c => c.Age).Distinct().ToList();
That simple. The Select is not available for use until you add System.Linq namespace.
The revised code will then be as follows:
<face>
public partial class Default1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
List<Person> people = new List<Person>();
people.Add(new Person() { FirstName = "Gill", LastName = "Julian", Age = 20 });
people.Add(new Person() { FirstName = "Hill", LastName = "Andrew", Age = 19 });
people.Add(new Person() { FirstName = "Hart", LastName = "Brett", Age = 24 });
people.Add(new Person() { FirstName = "Dwight", LastName = "Jane", Age = 20 });
people.Add(new Person() { FirstName = "Gary", LastName = "Gray", Age = 18 });
people.Add(new Person() { FirstName = "Prim", LastName = "Anne", Age = 19 });
List<int> distinctAges = new List<int>();
distinctAges = people.Select(c => c.Age).Distinct().ToList();
}
public class Person
{
public string FirstName;
public string LastName;
public int Age;
}
}
Thanks everyone
|
|
|
|
|
I have a single templated column in a DataGrid, in an ASP.NET 2 web site. The DataGrid is paged, with ten rows per page.
In Firefox, all is good, as nearly always, but when I view the site trough IE, I get the following exception:
“ Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page.”
Any ideas on what may cause this?
|
|
|
|
|
Hello EveryOne..
I want to show thousands of thousands distinct records in a Dropdownlist for single coulmn.
due to this page runs very slow.....
Is It possible to do a pagination Dropdownlist....?.
if Yes : then
i want user will able to see 15 records at time & then pagination(i.e., [Up and Down arrows] OR [Prev or NextButtons]).
or else
pls suggest what to do in this situation
Thanks..
T&R,
bhaskar
|
|
|
|
|
From where are you going to read records? why are you going to show thousands of records in dropdown list ? First Think About this question !
Try to show records as minimum as records possible is dropdown , use filter on records based on user.
If you have to then you can use Ajax for retreiving data from data bases, that based on user input, you will search data from database.
cheers,
Abhijit
|
|
|
|
|
Hi ...
ALL i m fetching from Database!!!
Records are not showing as per user. Its been showing as per Regions.
& the Field i m using to display is Deal No.
I'll Tell u my requirement..
I m having a grid...is has got result of morethan 20 to 30 thousand of records...at time i m showing only ..30 records in a grid..
Some of my columns of grid has Header Dropdownlist which is used to filter the grid records.
In header Dropdownlist i m showing all distinct values of that column.
Hope u got the point..Now tell me is it possible to have pagination in dropdownlist..?
Cheers
T&R,
bhaskar
|
|
|
|
|
Bhaskar141985 wrote: I m having a grid...is has got result of morethan 20 to 30 thousand of records...at time
you are going to read all data at a time ?
Bhaskar141985 wrote: 30 records in a grid..
You are going to use paging in Grid ?
Bhaskar141985 wrote: Some of my columns of grid has Header Dropdownlist which is used to filter the grid records.
In header Dropdownlist i m showing all distinct values of that column.
Based on user selection , you will show data to user , which will be retreive from data or already loaded in dataset?
can you please confirm those .
cheers,
Abhijit
|
|
|
|
|
Hi Coders
Could u tell me how can i Make report from database in ASP.net.
Any help would be appreciated
Amit
|
|
|
|
|
Hi,
there are several options; you could use crystal reports or program a website displaying a gridview as report etc.
Regards
Sebastian
P.S.: Please be so kind to be more specific about the problem. (And as others already mentioned, use google first )
|
|
|
|
|
Could u tell me by .rdlc and Report Viewer
|
|
|
|
|
Use Crystal Reports
cheers,
Abhijit
|
|
|
|
|
Only as a last resort - I hate it
Bob
Ashfield Consultants Ltd
|
|
|
|