|
Hi
I am having problem with reading configSections from web.config file.
Can anyone provide a sample code, how to read this group.
Following in the web.config:
<configurations>
<configsections>
<sectiongroup name="merchants">
<sectiongroup name="merchant" type="System.Configuration.NameValueSectionHandler, System, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null">
</sectiongroup>
</sectiongroup>
</configsections>
<merchants>
<merchant>
<add key="name" value="shehzad" />
<add key="url" value="localhost" />
</merchant>
</merchants>
I am trying following code to read but the object a contains null value.
NameValueCollection a = (NameValueCollection)ConfigurationSettings.GetConfig("merchants");
Shahzad Aslam
Software Engineer
modified on Wednesday, February 13, 2008 12:38 AM
|
|
|
|
|
web.config file text
<code><configuration>
<appsettings>
<add key="connection" value="User ID=11;password=111;DataBase=11111;Data Source=localhost" />
<add key="MyPractice_DataAccessLayer_Type" value="11" />
<add key="111" value="111" />
</appsettings>
<connectionstrings>
<add name="MyPracticeConnectionString" connectionstring="Data Source=RAJEEV;Initial Catalog=MyPractice;Integrated Security=True" providername="System.Data.SqlClient" /></connectionstrings></code>
to read that
in c#
using system.configuration;
string connectionsttring=configurationmaneger.appsettings["connection"].tostring();
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
modified on Wednesday, February 13, 2008 12:48 AM
|
|
|
|
|
This was not the one that I was expecting. The appsettings section can be read easily but my concern was to read ConfigSections group which we used for our customized section.
Shahzad Aslam
Software Engineer
Softech Systems Limited
Email: shehzadaslam@hotmail.com
|
|
|
|
|
Hi,
hope this link[^] will hwlp you.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
In VB.NET
First U imports comfig setting
Imports System.Configuration
Ofter that u get AppSetting value
dim str as string = ConfigurationManager.AppSettings("serverurl")
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
hi every buddy
i am using image signature in a page .
in situation of wrong text input, image must be change without refreshing all data of page. then how to reload image signature on the page in that situation where real image in on the other page .
please give me a solution
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
|
|
|
|
|
RajeevKumarSharma wrote: without refreshing all data of page
This means AJAX, or it means changing the image URL using javascript, if you know what the other image is when the page is generated.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
actual problem is that
1- image crated on the imgvar.aspx
2- calling that image on registration.aspx
<asp:image id="Image1" runat="server" imageurl="~/imgvar.aspx">
3- and now if user enter the wrong signature then that image should be change . then how to refresh that image and imgvar.aspx page for new image.
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
|
|
|
|
|
well, imgvar.aspx does not exist anymore. So, you need to know what image you want to show, either on the server ( which means an AJAX call ) or have it embedded in the script if you know it, so you can just set it on the client. But, if you need to store some data so the next time the user goes to imgvar.aspx they see a different image, then you probably need the AJAX call if you don't want a postback. imgvar.aspx will need to rebuild itself to show the new image you want it to show, and it will need to do that in response to state that is stored ( probably in your database, I am guessing ), by the ajax call from registration.aspx.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Refer a capcha implementation here:
http://www.codeproject.com/KB/aspnet/CaptchaImage.aspx[^]
To refresh the image, simply have a JavaScript function which sets a blank.gif and set SRC value as a new call to aspx page with a random number to prevent caching.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi,
I want to open the tif files in web pages. but picture box will not support tif files. How convert tif files into gif or jpeg files programatically when i retrieve the data from database (I am storing only the path of picture files).
|
|
|
|
|
Really, you need to run a batch converter to convert them into the right format at the point of storage, not at the point of retrieval. GDI+ will load a tif, and store it as a jpg.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you. I too think so. But the images have been stored already. Is there is no way to solve this problem?
|
|
|
|
|
Not really - you can write code to generate a new jpg out of the tif image, but that seems like a pain to me. Why not just run a batch converter, then do an update to your db to replace .tif with .jpg ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
In that case I have to update the database. Thank you Graus.
Chaitra N
|
|
|
|
|
|
Hi guys
My problem is this . I need to generate a large number of records from SQL server 2000 to and excel spreadsheet. However the durations of time id too long. For about 900 records there's about 40 min.
Any idea or guide to boast up the speed?
i am generating to excel .xls
Basically i have a main details table link to many sub details Table
Then first i select all the main info id and use the for loop to loop through all the sub details table whether the id is match. then insert into the excel spreadsheet. The method i use is Create the XLS file then connect to it and do insert statement to input data. This method work but when inserting 900 records it took about 30 mins or more....
Any suggetion or solution please guide.... Need help man
Thanks a million guys need it urgently
KaKaShi HaTaKe
|
|
|
|
|
Why are you asking this in the ASP.NET forum ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Becasue i am using ASP.net to generate the reports. Is a Web applications
KaKaShi HaTaKe
|
|
|
|
|
OK, but it doesn't relate to the presentation tier, so it's really a VB.NET or C# question. I'm only saying because asking in the right forum will get you more coverage and more answers.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
OK got it thanks bro
KaKaShi HaTaKe
|
|
|
|
|
hello frnds,
i have .Net framework 2.0 installed on my machine, I was developed one website which was run fine. But yesterday i upgrade the SP1 of .Net framework and my site gives scripting errors over there. i used Javascript, VBScript in website and take HTML buttons.
what should be the problem ???
any setting after installing SP1 ???
Thankx in Advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
koolprasad2003 wrote: But yesterday i upgrade the SP1 of .Net framework and my site gives scripting errors over there.
Really?? I too have websites which is developed in .NET 2.0 framework previously and I have upgraded my VS 2005 with SP1. They are working fine as before.
koolprasad2003 wrote: what should be the problem ???
What is the error, you are talking about? Could you please post somemore information about your errors?
Did you tried to convert you websites to web applications??
|
|
|
|
|
Hi All,
I have created a table called tblState in access with 2 columns: id and state and am populating a dropdownlist with state.
I am in need of code to delete a selected value of dropdownlist from database in asp.net2.0 using c#.
Can anybody help me please.
Thanks
Wajid
|
|
|
|
|
On postback, you can tell what your selected item is, what you need to be able to do, is turn that into an id you can use to delete the right record in the database. You do that when you populate the list, by using the unique ids as the data value for the list item ( the value that is not displayed )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|