|
Hello all,
I have got three buttons and three list boxes(that will be populated dynamically). These list boxes will show some text that will be coming from the database and that text corresponds to the page name which needs to be stored in a array. I need to create an arraylist to hold page names and once the button is clicked the listbox should become visible with the relative text and once the list item is selected, it should look for the corresponding pagename in the arraylist and display a message. Can someone please help me this?
Thanks!
|
|
|
|
|
hi all,
i have a doubt. where can we use hash table?? i mean i know what is Arraylist and what is Hash table. but i don't know where can we use these?? Arraylist can be used where we don't know about the upper bound..is it correct??
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Rahithi wrote: Arraylist can be used where we don't know about the upper bound..is it correct??
You will always know the upper bound in an array list. It is just dynamic (it changes).
A hashtable is keyed on another object.
When accessing the values through the indexer an ArrayList can only by accessed by the ordinal position of an object in the array.
When accessing a hashtable through the indexer you use the object used as a key (often this is a string).
|
|
|
|
|
I have two Controls: StartDate and EndDate. The End Date cannot be more than 30 days from the Start Date. How Do I Validate This? Can I use one of the Validator Controls?
|
|
|
|
|
type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
I want to write a custom section that can be added to configuration file (web.config)... I dont understand all the parts of the "type" attribute
1)PublicKeyToken --- Is this the one generated thru sn.exe???
2)System.Configuration.AppSettingsSection --- Is this any name or should it be my class name
3) System.Configuration --- what about this ???
yojimbo
|
|
|
|
|
red60mans wrote: 1)PublicKeyToken --- Is this the one generated thru sn.exe???
You can see the PublicKeyToken value when your assembly is made strong-named, otherwise it's a null value.
red60mans wrote: 2)System.Configuration.AppSettingsSection --- Is this any name or should it be my class name
It should be your fully qualified name of your class as you here want to create a custom config entry.
red60mans wrote: 3) System.Configuration --- what about this ???
This is the namespace containing your custom config handler class. Basically, when you define a custom configuration section, you'll have to specify the handler for this section and you also need to tell the system about how to locate the type of your class. For more information, see ASP.NET Configuration [^]
|
|
|
|
|
hi all
i need to add a caculated field into the datagrid. A field that is not found actually in the data base. like total which is price*qty.
any help!!!
thanks
|
|
|
|
|
|
hi,
I have a login form. when i login with my user name it should be redirected to another form. in that form i have a table column with days monday to sunday in which i have 6 text boxes under each day namely intime, outtime, extratime,nonworktime,leavehrs and total. In that if i enter the values for each textboxes ie.., in hours(user enters it daily-day by day) , all the values should be submitted in the database for the corresponding days and should not be able to modify the values which are entered once. Can anybody pls send me source code for this in c# code behind or pls give me a solution for this.
Regards
Kavi
|
|
|
|
|
What code have you written so far?
Kevin
|
|
|
|
|
I am trying to add controls to the toolbox for an Ajax site I am building (VS2005 & C#).
I have a sample web.config and it suggests that I need a section called:
sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
However, I already have a similar section called:
sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Which one should I be using ?
Thanks.
-- modified at 15:37 Friday 2nd February, 2007
|
|
|
|
|
You should use the first one as the name Microsoft.Web.Extensions is changed in the RTM, more details can be found here[^]
|
|
|
|
|
I need to create an web page interface for a database
in ASP.NET with C# and I have some problems :
1. First of all how can I connect to the database and how
can I make queries. Sould I use the "DataSource" control or
is it better to connect with code only ?
(The database is on my PC)
2. As I can see there are two types of buttons. The first
is the standard that leads to write code in the *.aspx.cs
file. The second is the HTML button that leads to write code
in the *.aspx file. The first button however is invisible in
my browser. Why is that ?
If you could tell me how to connect to my database in an MFC
project instead of ASP and how to make queries it would be nice too.
I was really disapointed that noone in this site hasn't posted an article
on this matter (Am I wrong?). Anyway, this is the best programming site
there is.
Any kind of help would be much appreciated.
kostas KEL
|
|
|
|
|
Hi,
It is not possible to write about details of Database connectivity in .NET in this reply. I am giving you a few hints. Using a good book and googling will show you the way.
Important namespaces for connectivity and data related activity.
System.Data.SqlClient - for Sql Server
System.Data.OracleClient - for Oracle
System.Data.Odbc - for other database.
System.Data
Please read about these namespaces.
Read about SqlConnection , SqlCommand and SqlDataAdapter in System.Data.SqlClient .
Similar classes also exist for other namespaces.
Apart from it you need to know about DataSet , SqlDataReader etc.
Pradipta Basu
|
|
|
|
|
KEL3 wrote: First of all how can I connect to the database and how
can I make queries.
Small question, big answer - people have written entire books answering that question. Get a book on ADO.NET. Personally, I use SqlConnection and SqlCommand and the Enterprise Libraries.
KEL3 wrote: As I can see there are two types of buttons. The first
is the standard that leads to write code in the *.aspx.cs
file. The second is the HTML button that leads to write code
in the *.aspx file. The first button however is invisible in
my browser. Why is that ?
I don't know. You need to post some code. The "standard" buttons work for me. Have you set any properties that would make it invisible?
KEL3 wrote: If you could tell me how to connect to my database in an MFC
project instead of ASP and how to make queries it would be nice too.
Off topic - ask this in the C++ forum.
KEL3 wrote: I was really disapointed that noone in this site hasn't posted an article
on this matter (Am I wrong?).
Umm.. Did you try searching for any? I typed in "connect database MFC" into the search facility here and I got back 36 possible articles that you might find useful.
|
|
|
|
|
I need to display images that are contained within our corporate firewall on a clients' web site (which is hosted on a server outside of our company.
Currently, the only way I've been able to grant them access to these images is to impersonate a specific user in the web.config file:
<identity impersonate="true" username="DOMAIN\username" password="password">
This provides a security problem however because if anyone were to ever somehow get a hold of this web.config file, they could use this info to hack into the server. So I'm looking for an alternative method.
Anyone know any other approaches I could take to display these internal images?
Thanks.
-Goalie35
Thanks.
|
|
|
|
|
i have an ASP.net textbox on my form and a dropdownlist too on my form. How can i set the text to "hiii" using JavaScript? IS this correct
document.Form1.txtTextBox.value="hiii";
I would also like to set the dropdownlist selected index to 0.
How do I do this? As simple as it may sound just bear withe me guys. i really dont know a !@#$ about JavaScript and this is really urgent. I've learnt my lesson though. Tomorrow i'm going to go my self a really good book to teach me this stuff. In the meantime, it'd be great if you could just help me.
|
|
|
|
|
You'd need to use document.getElementById(myControlId).value='some text'
The thing to watch out for though is that the control name you defined will probably be prefixed with _ctl0_ or something similar. You can use the object.ClientId attribute on the server side to find out what it should be.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi all
I have a datagrid, which holds item name, item price, and its image(all from SQL Server database), what I need is when the user clicks on the image, I need the (id) for the item to be carried to the new page where I want to show more details about the item (expiry date, ...)
thanks alot
|
|
|
|
|
Hi all,
I am using a datagrid to display some data.The problem is i want to display my own column name rather than those in database.I am using data adapter and dataset to fill data.
Also how can i show only date in the data grid when the contents in the database is date time.It shows date as well as 12AM in addition which i haven`t inserted.
|
|
|
|
|
use this
<br />
<asp:TemplateColumn HeaderText="Date"><br />
<ItemTemplate"><br />
<# FormatDate(DataBinder.Eval(Container.DataItem, "DBDate")) %"><br />
<ItemTemplate"><br />
</asp:TemplateColumn"><br />
Use a TemplateColumn as shown above where DBDate is your database data field. FormatDate is your own function to format date. The function can be like this shown below.
<br />
public static string FormatDate(object oInput)<br />
{<br />
if(oInput != null)<br />
{<br />
if(oInput != DBNull.Value)<br />
return ((DateTime)oInput).ToString("MM-dd-yy");<br />
else<br />
return string.Empty;<br />
}<br />
else<br />
return string.Empty;<br />
}
Hope this will help
Pradipta Basu
|
|
|
|
|
Thank you.
This has helped me a lot.
|
|
|
|
|
:-OYou can use
"select customer as my_lovername from table_name"
Then column will show my_lovername,
wish it can help you!
jeam
|
|
|
|
|
Define a <columns> collection in the grid, then add column definitions, including the HeaderText attribute
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I'm using CompareValidator to validate a TextBox control in FormView. I want to compare with a Label. I find however that when I select ControlToCompare, the Label isn't listed. The only controls to choose from are TextBoxes. And yes the Label does exist and is visible! Any ideas?
Many Thanks
Maj
|
|
|
|