|
Hi How to add some records in array list?,
For ex in static:
i am adding records in arraylist the below format...,
Dim _Text As ArrayList = New ArrayList
_Text.Add("Admin Master")
_Text.Add("HR")
_Text.Add("Purchase")
Suppose this text are in my table...,
Then how to add those in arraylist...,
Regards,
Magi
|
|
|
|
|
Looping through number of rows of table and add rows values in array
for Example
foreach(DataRow dr in ds.Table[0].Rows)
{
arr.Add(dr["AdminMaster"].ToString());
arr.Add(dr["HR"].ToString());
arr.Add(dr["Purchase"].ToString());
}
BesT regArd
pathan
|
|
|
|
|
Hi,
I have a gridview that is populated from my FUsers table. The stored procedure that returns the results sorts it by last name and first name. Now I don't want to change the sorting of the stored procedure. I want to keep it just like it is. But the gridview needs to be sorted by creation date. Is there a way of sorting a gridview so that it displays everything by sorted creation date?
Please cab someone advise.
Thanks
|
|
|
|
|
If you are using SqlDataSource then set its property "DataSourceMode=DataSet" then SqlDataSource does all that you need.
Intelligence is measured by common sense not by how many scholarly books you read.
|
|
|
|
|
I'm using a object data source like below:
<asp:objectdatasource
id="odsUsers"
="" selectmethod="GetAllUsers" typename="Flowers.BusinessLogicLayer.FUser" runat="server">
I don't use a data set, it's generic lists like:
public static List<fuser> GetAllUsers()
{
return FUserDA.GetAllUsers();
}
I hope you can help.
Thanks
|
|
|
|
|
Right, would suggest the following:
Change your List to generic List<Flowers.BusinessLogicLayer.FUser> and adding an anonymous method, so you end up with:
List<Flowers.BusinessLogicLayer.FUser> fusers = FUserDA.GetAllUsers();
fusers.Sort(delegate(FUser f1, FUser f2)
{
return Comparer<DateTime>.Default.Compare(f1.CreationDate,
f2.CreationDate);
});
return fusers;
Cheers
Ben
|
|
|
|
|
Hi
What object are you binding the GridView to?
If it's a DataSet, then you can change it to bind to the DefaultView of the table within it ds.Tables[0].DefaultView.
Then before you do this, you can call ds.Tables[0].DefaultView.Sort("CREATIONDATE DESC").
Cheers
Ben
|
|
|
|
|
Hi,
Please see my reply to _ * _ =>
Thanks
|
|
|
|
|
Hi everyone, I have problem with AccessKey. I created the following code.
It works fine in IE but it fails to work with firefox.
Any solution?
<asp:label skinid="LabelColumn" id="LabelCode" associatedcontrolid="CodeTextBox" accesskey="C" runat="server" text="<u>C</u>ode:">
<asp:textbox id="CodeTextBox" runat="server" text="<%# Bind("Code") %>" maxlength="20">
Thank you
Intelligence is measured by common sense not by how many scholarly books you read.
|
|
|
|
|
It's my same qus. I am not pick the Text through query string.
I have write this code.
String StrCom;
StrCom=Convert.ChangeType(Request.QueryString.GetValues("Pivid")(0),String);
Label5.Text = StrCom;
Display Two Error: Method Name Expeced and String is type but is used to
like a variable
Please Correct This Syntax
|
|
|
|
|
u use this its working yaar
string StrCom = Request.QueryString["CID"];
Label1.Text = StrCom;
and send me how u passing qry string and send url which contain text.
Piyush Vardhan Singh
|
|
|
|
|
I have been trying this code for One hour.
Pick a Value not for text.
|
|
|
|
|
it workin on mysd what ur query string url where u pic this text send me
Piyush Vardhan Singh
|
|
|
|
|
Hi friend
Can I run a code when my webform is closing? I want to send "Bye" to a computer in network when user close the form.
thanks
|
|
|
|
|
You can use the onunload event to do something when the user leaves the page. You have to keep track of why the user is leaving, though, as the event is triggered regardless of why the user is leaving the page. Even a postback counts as leaving the page.
You have to make a request to communicate with the server, either by opening a new window, or using AJAX.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
on unload event which is in the body tag there i am calling the meeeage box .which is appearing for all the buttons.Why it is happening?
and one more thing , i have a function defined i the code behind file , how can i call that funcion on closing the form , i mean on closing the form i am getting the confirm message , if the user click the yes button , at that moment i want to execute that funciton.
How should i do it?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: on unload event which is in the body tag there i am calling the meeeage box .which is appearing for all the buttons.Why it is happening?
As I said, the event is triggered whenever the user leaves the page, regardless of the reason.
Sonia Gupta wrote: and one more thing , i have a function defined i the code behind file , how can i call that funcion on closing the form , i mean on closing the form i am getting the confirm message , if the user click the yes button , at that moment i want to execute that funciton.
As I said, you have to send a request to the server, either by opening a new window or using AJAX.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
hi ,
i am designing an indexing server.here i want to display the values based on wildcards.
plz help me to write the command for display the wildcard values in indexing server results using asp.net
with regards
venkat
|
|
|
|
|
I'm coding login and logout pages.My problem is,first i login with username "A" and then logout.After that i login with another username "B" but login page didn't redirect to index.aspx and i cannot log in anymore.-*-
i think it's about cache of each pages.but i don't known where to fixed it.
for LogIn.aspx
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
if (CheckAuthenticate(Login1.UserName, Login1.Password))
{
Session["Username"] = Login1.UserName;
Session["Password"] = Login1.Password;
Session["Authentication"] = "1";
if (Login1.RememberMeSet)
{
Response.Cookies["AuthenCookies"]["User"] = Login1.UserName;
Response.Cookies["AuthenCookies"].Expires = DateTime.Now.AddMonths(1);
}
e.Authenticated = true;
FormsAuthentication.RedirectFromLoginPage((string)Session["Username"]
, false);
}
else
{
Session["Authentication"] = "0";
e.Authenticated = false;
}
}
for LogOut.aspx
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Session["Username"] = null;
Session["Password"] = null;
Session["Authentication"] = null;
Session.Abandon();
FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
}
In Page_Load function of each pages, i added this code.
Response.Cache.SetCacheability(HttpCacheability.NoCache);
string LoginPass = (string)Session["Authentication"];
if (LoginPass == "0" || LoginPass == null)
Response.Redirect("LogIn.aspx");
Thank for help. =)
|
|
|
|
|
CREATE FUNCTION [dbo].[waste] () <br />
RETURNS table<br />
<br />
AS <br />
declare @a int<br />
declare @b int<br />
BEGIN <br />
declare cur cursor for select a1,a2 from a<br />
open cur<br />
fetch next from a into @a,@b<br />
while @@FETCH_STATUS =0<br />
BEGIN<br />
SELECT @a as a1 , @b as a2<br />
fetch next from a into @a , @b<br />
END<br />
close cur<br />
deallocate cur<br />
return<br />
END
where is the bug lying?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
The main problem is that you are posting an SQL question in the ASP.NET forum.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Hi there,
Screen Shot
I need some help regarding the screen shot above of my current windows application.
What would be the best way to design this layout in ASP.Net?
I'm trying to avoid as many tables as possible.
When should I use tables and when should I use div tags?
Any link or resources on where to find tutorials on converting windows apps to web apps would be greatly appreciated.
I tried googling but no luck.
Thanks
|
|
|
|
|
GermanDM wrote: I'm trying to avoid as many tables as possible.
Why, tables are always good to format the page and align the controls in expected positions. I think creating design with tables will be good option. Usually div tag is used to group elements and to format with styles. Browsers will add a line break tag for each div. So creating entire page avoiding tables is not looking good to me.
|
|
|
|
|
Well i read that tables slow your app down. Even tho this app will only be used as intranets on networks so should be fine then.
I agree that using tables is the easiest way to setup "input/forms".
I do use div to setup the main layout tho.
Do you know of any resources on where I can find more info regarding writing actual web apps like windows apps not just normal web apps with a contact form. Im looking for help on writing websites which is based on alot of server side work.
Thanks for your reply
|
|
|
|
|
See this[^], but this is just opposite to what I said
|
|
|
|