Saturday, March 31, 2012
Sending/Receiving data from remote app
Anyone done something similar?how is the remote app usually contacted. Does it send back a httpresponse. or is it some service that returns a stream of characters.
HTTPResponse object if it's replying in http
probably SOCKETS if it's returning data ( like telnet)
I have no experience doing this - but hope that points you in right direction
SendingEMail
the code below to send it.
mailMsg := MailMessage.Create;
mailMsg.From := self.Session['SMTPADDRESS'].ToString;
mailMsg.&To := aEMail;
mailMsg.BCC := aAdminEMail;
mailMsg.Subject := 'Your LoginID and Password';
mailMsg.BodyFormat := MailFormat.Text;
mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
'''+aPassword+'''';
SmtpMail.SmtpServer := aSMTPServer;
SmtpMail.Send(mailMsg);
My mail server requires password authentication. Where do I assign the
password?
TIAThe following solution is officially unsupported - but it works (you
otherwise need to use CDO or something else to authenticate).
Add these lines to your code before you call SmtpMail.Send()
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthe
nticate",
"1"); //basic authentication
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusern
ame",
myLoginID); //set your username here
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassw
ord",
myPassword); //set your password here
-HTH
"gh" <gh@.at.ne> wrote in message
news:OFCyfZsjFHA.3012@.TK2MSFTNGP12.phx.gbl...
>I have an ASP.NET web app that I am trying to sens an email from. I use
>the code below to send it.
> mailMsg := MailMessage.Create;
> mailMsg.From := self.Session['SMTPADDRESS'].ToString;
> mailMsg.&To := aEMail;
> mailMsg.BCC := aAdminEMail;
> mailMsg.Subject := 'Your LoginID and Password';
> mailMsg.BodyFormat := MailFormat.Text;
> mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
> '''+aPassword+'''';
> SmtpMail.SmtpServer := aSMTPServer;
> SmtpMail.Send(mailMsg);
> My mail server requires password authentication. Where do I assign the
> password?
> TIA
Check this out
http://www.systemwebmail.com/faq/3.8.aspx
info@.donotspam dowhileloop.com
http://www.dowhileloop.com -- Website Development
http://publicjoe.dowhileloop.com -- C# & VB.NET Tutorials
"gh" <gh@.at.ne> wrote in message
news:OFCyfZsjFHA.3012@.TK2MSFTNGP12.phx.gbl...
> I have an ASP.NET web app that I am trying to sens an email from. I use
> the code below to send it.
> mailMsg := MailMessage.Create;
> mailMsg.From := self.Session['SMTPADDRESS'].ToString;
> mailMsg.&To := aEMail;
> mailMsg.BCC := aAdminEMail;
> mailMsg.Subject := 'Your LoginID and Password';
> mailMsg.BodyFormat := MailFormat.Text;
> mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
> '''+aPassword+'''';
> SmtpMail.SmtpServer := aSMTPServer;
> SmtpMail.Send(mailMsg);
> My mail server requires password authentication. Where do I assign the
> password?
> TIA
Separate .config file
config file on, in addition to the web.config file that's already
working in the application.
If I put the following in the web.config file (VS 2005, Framework 2.0),
I can retrieve the values fine:
<appSettings>
<add key="fileInputFolder" value="C:\National City Downloads\test"/>
<add key="fileTransaction" value="\Transactions\"/>
<add key="TimerInterval" value="20000"/>
<add key="Conn" value ="Data Source=dellserver\sql2000;Initial
Catalog=CIC_BankModel;Persist Security Info=True;User
ID=sa;Password=adminsql"/>
</appSettings>
I retrieve the value with this line in the codefile in one of the apps
on the page:
Session("MyExchangeServer") =
WebConfigurationManager.AppSettings("fileInputFolder").ToString
The placement of the above appsettings line is right after the
</system.webin the web.config file, and immediately before the
<system.netline.
Any of those values can be read with no problem if they're in the
web.config file.
I added a new item to my project, app.config.
It looks like this:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
<add key="fileInputFolder" value="C:\National City Downloads\test"/>
<add key="fileTransaction" value="\Transactions\"/>
<add key="TimerInterval" value="20000"/>
<add key="Conn" value ="Data Source=dellserver\sql2000;Initial
Catalog=CIC_BankModel;Persist Security Info=True;User
ID=sa;Password=adminsql"/>
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" />
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
It returns this message when I try to load the page.
The format of a configSource file must be an element containing the name
of the section. (C:\Inetpub\wwwroot\test\App.config line 10)
The only thing I have changed from the original app.config file was
where appSettings was already in the file, in the form <appSettings/>.
Where you see the <appSettingsand the 3-4 lines followed by the
</appSettings>, I simply replaced it.
The exact error on the page is:
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
Parser Error Message: The format of a configSource file must be an
element containing the name of the section.
Source Error:
Line 8: \Windows\Microsoft.Net\Framework\v2.x\Config
Line 9: -->
Line 10: <configuration>
Line 11: <appSettings>
Line 12: <add key="fileInputFolder" value="C:\National City
Downloads\test"/>
Source File: C:\Inetpub\wwwroot\test\App.config Line: 10
------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210
Any idea what I am doing wrong on this? I'd like to do some more with
this alternate config file, but I'm just trying to get the simple stuff
to work, before I do anything else.
Thanks,
BCBlasting Cap,
The use of the ConfigSource attribute is as follows:
Each section that supports configSource gets specified as
<membership configSource="config\membership.config"/>
In the membership.config (name doesn't matter), you would specify only the
membership section.
<membership defaultProvider="CustomSqlMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="CustomSqlMembershipProvider"
connectionStringName="<connString>"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
applicationName="<appname>"
requiresUniqueEmail="false"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="5"
passwordFormat="Hashed"
enablePasswordRetrieval="false"
enablePasswordReset="true"/>
</providers>
</membership>
Here is some more info:
http://weblogs.asp.net/fmarguerie/a...tion-files.aspx
Hope this helps,
Steve
"Blasting Cap" <goober@.christian.netwrote in message
news:eqYkXt4pHHA.1216@.TK2MSFTNGP03.phx.gbl...
Quote:
Originally Posted by
>
I am working on a web app that I want to be able to use a separate config
file on, in addition to the web.config file that's already working in the
application.
>
If I put the following in the web.config file (VS 2005, Framework 2.0), I
can retrieve the values fine:
>
<appSettings>
<add key="fileInputFolder" value="C:\National City Downloads\test"/>
<add key="fileTransaction" value="\Transactions\"/>
<add key="TimerInterval" value="20000"/>
<add key="Conn" value ="Data Source=dellserver\sql2000;Initial
Catalog=CIC_BankModel;Persist Security Info=True;User
ID=sa;Password=adminsql"/>
</appSettings>
>
I retrieve the value with this line in the codefile in one of the apps on
the page:
>
Session("MyExchangeServer") =
WebConfigurationManager.AppSettings("fileInputFolder").ToString
>
The placement of the above appsettings line is right after the
</system.webin the web.config file, and immediately before the
<system.netline.
>
Any of those values can be read with no problem if they're in the
web.config file.
>
I added a new item to my project, app.config.
>
It looks like this:
>
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
<add key="fileInputFolder" value="C:\National City Downloads\test"/>
<add key="fileTransaction" value="\Transactions\"/>
<add key="TimerInterval" value="20000"/>
<add key="Conn" value ="Data Source=dellserver\sql2000;Initial
Catalog=CIC_BankModel;Persist Security Info=True;User
ID=sa;Password=adminsql"/>
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" />
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
>
<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
>
</configuration>
>
>
It returns this message when I try to load the page.
>
The format of a configSource file must be an element containing the name
of the section. (C:\Inetpub\wwwroot\test\App.config line 10)
>
The only thing I have changed from the original app.config file was where
appSettings was already in the file, in the form <appSettings/>. Where you
see the <appSettingsand the 3-4 lines followed by the </appSettings>, I
simply replaced it.
>
The exact error on the page is:
>
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
>
Parser Error Message: The format of a configSource file must be an element
containing the name of the section.
>
Source Error:
>
>
Line 8: \Windows\Microsoft.Net\Framework\v2.x\Config
Line 9: -->
Line 10: <configuration>
Line 11: <appSettings>
Line 12: <add key="fileInputFolder" value="C:\National City
Downloads\test"/>
>
>
Source File: C:\Inetpub\wwwroot\test\App.config Line: 10
>
>
------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210
>
>
Any idea what I am doing wrong on this? I'd like to do some more with
this alternate config file, but I'm just trying to get the simple stuff to
work, before I do anything else.
>
Thanks,
>
BC
Steve -
thanks for the assistance. With your example and the link, I finally
saw what I was doing....
Thanks!!
BC
PlatinumBay wrote:
Quote:
Originally Posted by
Blasting Cap,
>
The use of the ConfigSource attribute is as follows:
>
Each section that supports configSource gets specified as
<membership configSource="config\membership.config"/>
>
In the membership.config (name doesn't matter), you would specify only the
membership section.
>
<membership defaultProvider="CustomSqlMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="CustomSqlMembershipProvider"
connectionStringName="<connString>"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
applicationName="<appname>"
requiresUniqueEmail="false"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="5"
passwordFormat="Hashed"
enablePasswordRetrieval="false"
enablePasswordReset="true"/>
</providers>
</membership>
>
Here is some more info:
http://weblogs.asp.net/fmarguerie/a...tion-files.aspx
>
Hope this helps,
>
>
Steve
>
"Blasting Cap" <goober@.christian.netwrote in message
news:eqYkXt4pHHA.1216@.TK2MSFTNGP03.phx.gbl...
Quote:
Originally Posted by
>I am working on a web app that I want to be able to use a separate config
>file on, in addition to the web.config file that's already working in the
>application.
>>
>If I put the following in the web.config file (VS 2005, Framework 2.0), I
>can retrieve the values fine:
>>
><appSettings>
> <add key="fileInputFolder" value="C:\National City Downloads\test"/>
> <add key="fileTransaction" value="\Transactions\"/>
> <add key="TimerInterval" value="20000"/>
> <add key="Conn" value ="Data Source=dellserver\sql2000;Initial
>Catalog=CIC_BankModel;Persist Security Info=True;User
>ID=sa;Password=adminsql"/>
> </appSettings>
>>
>I retrieve the value with this line in the codefile in one of the apps on
>the page:
>>
>Session("MyExchangeServer") =
>WebConfigurationManager.AppSettings("fileInputFolder").ToString
>>
>The placement of the above appsettings line is right after the
></system.webin the web.config file, and immediately before the
><system.netline.
>>
>Any of those values can be read with no problem if they're in the
>web.config file.
>>
>I added a new item to my project, app.config.
>>
>It looks like this:
>>
><?xml version="1.0"?>
><!--
> Note: As an alternative to hand editing this file you can use the
> web admin tool to configure settings for your application. Use
> the Website->Asp.Net Configuration option in Visual Studio.
> A full list of settings and comments can be found in
> machine.config.comments usually located in
> \Windows\Microsoft.Net\Framework\v2.x\Config
>-->
><configuration>
> <appSettings>
> <add key="fileInputFolder" value="C:\National City Downloads\test"/>
> <add key="fileTransaction" value="\Transactions\"/>
> <add key="TimerInterval" value="20000"/>
> <add key="Conn" value ="Data Source=dellserver\sql2000;Initial
>Catalog=CIC_BankModel;Persist Security Info=True;User
>ID=sa;Password=adminsql"/>
> </appSettings>
> <connectionStrings/>
> <system.web>
> <!--
> Set compilation debug="true" to insert debugging
> symbols into the compiled page. Because this
> affects performance, set this value to true only
> during development.
> -->
> <compilation debug="false" />
> <!--
> The <authenticationsection enables configuration
> of the security authentication mode used by
> ASP.NET to identify an incoming user.
> -->
> <authentication mode="Windows" />
> <!--
> The <customErrorssection enables configuration
> of what to do if/when an unhandled error occurs
> during the execution of a request. Specifically,
> it enables developers to configure html error pages
> to be displayed in place of a error stack trace.
>>
> <customErrors mode="RemoteOnly"
>defaultRedirect="GenericErrorPage.htm">
> <error statusCode="403" redirect="NoAccess.htm" />
> <error statusCode="404" redirect="FileNotFound.htm" />
> </customErrors>
> -->
> </system.web>
>>
></configuration>
>>
>>
>It returns this message when I try to load the page.
>>
>The format of a configSource file must be an element containing the name
>of the section. (C:\Inetpub\wwwroot\test\App.config line 10)
>>
>The only thing I have changed from the original app.config file was where
>appSettings was already in the file, in the form <appSettings/>. Where you
>see the <appSettingsand the 3-4 lines followed by the </appSettings>, I
>simply replaced it.
>>
>The exact error on the page is:
>>
>Configuration Error
>Description: An error occurred during the processing of a configuration
>file required to service this request. Please review the specific error
>details below and modify your configuration file appropriately.
>>
>Parser Error Message: The format of a configSource file must be an element
>containing the name of the section.
>>
>Source Error:
>>
>>
>Line 8: \Windows\Microsoft.Net\Framework\v2.x\Config
>Line 9: -->
>Line 10: <configuration>
>Line 11: <appSettings>
>Line 12: <add key="fileInputFolder" value="C:\National City
>Downloads\test"/>
>>
>>
>Source File: C:\Inetpub\wwwroot\test\App.config Line: 10
>>
>>
>------------------------
>Version Information: Microsoft .NET Framework Version:2.0.50727.42;
>ASP.NET Version:2.0.50727.210
>>
>>
>Any idea what I am doing wrong on this? I'd like to do some more with
>this alternate config file, but I'm just trying to get the simple stuff to
>work, before I do anything else.
>>
>Thanks,
>>
>BC
>
>
re:
!I want to be able to use a separate config file on, in addition to
!the web.config file that's already working in the application.
To use a separate config file for the appsettings section of web.config, use :
<appSettings configSource="somefile.config"/>
To enable the configuration to be recognized on any change to "somefile.config",
edit machine.config, in the <configSectionssection, and edit <section name="appSettings" ... >,
adding : restartOnExternalChanges="true"
That'd make it :
<section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="true"
requirePermission="false" />
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Blasting Cap" <goober@.christian.netwrote in message news:eqYkXt4pHHA.1216@.TK2MSFTNGP03.phx.gbl...
Quote:
Originally Posted by
>
I am working on a web app that I want to be able to use a separate config file on, in addition to
the web.config file that's already working in the application.
>
If I put the following in the web.config file (VS 2005, Framework 2.0), I can retrieve the values
fine:
>
<appSettings>
<add key="fileInputFolder" value="C:\National City Downloads\test"/>
<add key="fileTransaction" value="\Transactions\"/>
<add key="TimerInterval" value="20000"/>
<add key="Conn" value ="Data Source=dellserver\sql2000;Initial Catalog=CIC_BankModel;Persist
Security Info=True;User ID=sa;Password=adminsql"/>
</appSettings>
>
I retrieve the value with this line in the codefile in one of the apps on the page:
>
Session("MyExchangeServer") = WebConfigurationManager.AppSettings("fileInputFolder").ToString
>
The placement of the above appsettings line is right after the </system.webin the web.config
file, and immediately before the <system.netline.
>
Any of those values can be read with no problem if they're in the web.config file.
>
I added a new item to my project, app.config.
>
It looks like this:
>
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
<add key="fileInputFolder" value="C:\National City Downloads\test"/>
<add key="fileTransaction" value="\Transactions\"/>
<add key="TimerInterval" value="20000"/>
<add key="Conn" value ="Data Source=dellserver\sql2000;Initial Catalog=CIC_BankModel;Persist
Security Info=True;User ID=sa;Password=adminsql"/>
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" />
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
>
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
>
</configuration>
>
>
It returns this message when I try to load the page.
>
The format of a configSource file must be an element containing the name of the section.
(C:\Inetpub\wwwroot\test\App.config line 10)
>
The only thing I have changed from the original app.config file was where appSettings was already
in the file, in the form <appSettings/>. Where you see the <appSettingsand the 3-4 lines
followed by the </appSettings>, I simply replaced it.
>
The exact error on the page is:
>
Configuration Error
Description: An error occurred during the processing of a configuration file required to service
this request. Please review the specific error details below and modify your configuration file
appropriately.
>
Parser Error Message: The format of a configSource file must be an element containing the name of
the section.
>
Source Error:
>
>
Line 8: \Windows\Microsoft.Net\Framework\v2.x\Config
Line 9: -->
Line 10: <configuration>
Line 11: <appSettings>
Line 12: <add key="fileInputFolder" value="C:\National City Downloads\test"/>
>
>
Source File: C:\Inetpub\wwwroot\test\App.config Line: 10
>
>
------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
>
>
Any idea what I am doing wrong on this? I'd like to do some more with this alternate config file,
but I'm just trying to get the simple stuff to work, before I do anything else.
>
Thanks,
>
BC
Separate .config file
config file on, in addition to the web.config file that's already
working in the application.
If I put the following in the web.config file (VS 2005, Framework 2.0),
I can retrieve the values fine:
<appSettings>
<add key="fileInputFolder" value="C:\National City Downloads\test"/>
<add key="fileTransaction" value="\Transactions\"/>
<add key="TimerInterval" value="20000"/>
<add key="Conn" value ="Data Source=dellserver\sql2000;Initial
Catalog=CIC_BankModel;Persist Security Info=True;User
ID=sa;Password=adminsql"/>
</appSettings>
I retrieve the value with this line in the codefile in one of the apps
on the page:
Session("MyExchangeServer") =
WebConfigurationManager.AppSettings("fileInputFolder").ToString
The placement of the above appsettings line is right after the
</system.web> in the web.config file, and immediately before the
<system.net> line.
Any of those values can be read with no problem if they're in the
web.config file.
I added a new item to my project, app.config.
It looks like this:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
<add key="fileInputFolder" value="C:\National City Downloads\test"/>
<add key="fileTransaction" value="\Transactions\"/>
<add key="TimerInterval" value="20000"/>
<add key="Conn" value ="Data Source=dellserver\sql2000;Initial
Catalog=CIC_BankModel;Persist Security Info=True;User
ID=sa;Password=adminsql"/>
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
It returns this message when I try to load the page.
The format of a configSource file must be an element containing the name
of the section. (C:\Inetpub\wwwroot\test\App.config line 10)
The only thing I have changed from the original app.config file was
where appSettings was already in the file, in the form <appSettings/>.
Where you see the <appSettings> and the 3-4 lines followed by the
</appSettings>, I simply replaced it.
The exact error on the page is:
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
Parser Error Message: The format of a configSource file must be an
element containing the name of the section.
Source Error:
Line 8: \Windows\Microsoft.Net\Framework\v2.x\Config
Line 9: -->
Line 10: <configuration>
Line 11: <appSettings>
Line 12: <add key="fileInputFolder" value="C:\National City
Downloads\test"/>
Source File: C:\Inetpub\wwwroot\test\App.config Line: 10
----
--
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210
Any idea what I am doing wrong on this? I'd like to do some more with
this alternate config file, but I'm just trying to get the simple stuff
to work, before I do anything else.
Thanks,
BCBlasting Cap,
The use of the ConfigSource attribute is as follows:
Each section that supports configSource gets specified as
<membership configSource="config\membership.config"/>
In the membership.config (name doesn't matter), you would specify only the
membership section.
<membership defaultProvider="CustomSqlMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="CustomSqlMembershipProvider"
connectionStringName="<connString>"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
applicationName="<appname>"
requiresUniqueEmail="false"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="5"
passwordFormat="Hashed"
enablePasswordRetrieval="false"
enablePasswordReset="true"/>
</providers>
</membership>
Here is some more info:
http://weblogs.asp.net/fmarguerie/a...tion-files.aspx
Hope this helps,
Steve
"Blasting Cap" <goober@.christian.net> wrote in message
news:eqYkXt4pHHA.1216@.TK2MSFTNGP03.phx.gbl...
> I am working on a web app that I want to be able to use a separate config
> file on, in addition to the web.config file that's already working in the
> application.
> If I put the following in the web.config file (VS 2005, Framework 2.0), I
> can retrieve the values fine:
> <appSettings>
> <add key="fileInputFolder" value="C:\National City Downloads\test"/>
> <add key="fileTransaction" value="\Transactions\"/>
> <add key="TimerInterval" value="20000"/>
> <add key="Conn" value ="Data Source=dellserver\sql2000;Initial
> Catalog=CIC_BankModel;Persist Security Info=True;User
> ID=sa;Password=adminsql"/>
> </appSettings>
> I retrieve the value with this line in the codefile in one of the apps on
> the page:
> Session("MyExchangeServer") =
> WebConfigurationManager.AppSettings("fileInputFolder").ToString
> The placement of the above appsettings line is right after the
> </system.web> in the web.config file, and immediately before the
> <system.net> line.
> Any of those values can be read with no problem if they're in the
> web.config file.
> I added a new item to my project, app.config.
> It looks like this:
> <?xml version="1.0"?>
> <!--
> Note: As an alternative to hand editing this file you can use the
> web admin tool to configure settings for your application. Use
> the Website->Asp.Net Configuration option in Visual Studio.
> A full list of settings and comments can be found in
> machine.config.comments usually located in
> \Windows\Microsoft.Net\Framework\v2.x\Config
> -->
> <configuration>
> <appSettings>
> <add key="fileInputFolder" value="C:\National City Downloads\test"/>
> <add key="fileTransaction" value="\Transactions\"/>
> <add key="TimerInterval" value="20000"/>
> <add key="Conn" value ="Data Source=dellserver\sql2000;Initial
> Catalog=CIC_BankModel;Persist Security Info=True;User
> ID=sa;Password=adminsql"/>
> </appSettings>
> <connectionStrings/>
> <system.web>
> <!--
> Set compilation debug="true" to insert debugging
> symbols into the compiled page. Because this
> affects performance, set this value to true only
> during development.
> -->
> <compilation debug="false" />
> <!--
> The <authentication> section enables configuration
> of the security authentication mode used by
> ASP.NET to identify an incoming user.
> -->
> <authentication mode="Windows" />
> <!--
> The <customErrors> section enables configuration
> of what to do if/when an unhandled error occurs
> during the execution of a request. Specifically,
> it enables developers to configure html error pages
> to be displayed in place of a error stack trace.
> <customErrors mode="RemoteOnly"
> defaultRedirect="GenericErrorPage.htm">
> <error statusCode="403" redirect="NoAccess.htm" />
> <error statusCode="404" redirect="FileNotFound.htm" />
> </customErrors>
> -->
> </system.web>
> </configuration>
>
> It returns this message when I try to load the page.
> The format of a configSource file must be an element containing the name
> of the section. (C:\Inetpub\wwwroot\test\App.config line 10)
> The only thing I have changed from the original app.config file was where
> appSettings was already in the file, in the form <appSettings/>. Where you
> see the <appSettings> and the 3-4 lines followed by the </appSettings>, I
> simply replaced it.
> The exact error on the page is:
> Configuration Error
> Description: An error occurred during the processing of a configuration
> file required to service this request. Please review the specific error
> details below and modify your configuration file appropriately.
> Parser Error Message: The format of a configSource file must be an element
> containing the name of the section.
> Source Error:
>
> Line 8: \Windows\Microsoft.Net\Framework\v2.x\Config
> Line 9: -->
> Line 10: <configuration>
> Line 11: <appSettings>
> Line 12: <add key="fileInputFolder" value="C:\National City
> Downloads\test"/>
>
> Source File: C:\Inetpub\wwwroot\test\App.config Line: 10
>
> ----
--
> Version Information: Microsoft .NET Framework Version:2.0.50727.42;
> ASP.NET Version:2.0.50727.210
>
> Any idea what I am doing wrong on this? I'd like to do some more with
> this alternate config file, but I'm just trying to get the simple stuff to
> work, before I do anything else.
> Thanks,
> BC
Steve -
thanks for the assistance. With your example and the link, I finally
saw what I was doing....
Thanks!!
BC
PlatinumBay wrote:
> Blasting Cap,
> The use of the ConfigSource attribute is as follows:
> Each section that supports configSource gets specified as
> <membership configSource="config\membership.config"/>
> In the membership.config (name doesn't matter), you would specify only the
> membership section.
> <membership defaultProvider="CustomSqlMembershipProvider"
> userIsOnlineTimeWindow="15">
> <providers>
> <clear/>
> <add name="CustomSqlMembershipProvider"
> connectionStringName="<connString>"
> type="System.Web.Security.SqlMembershipProvider, System.Web,
> Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
> applicationName="<appname>"
> requiresUniqueEmail="false"
> minRequiredPasswordLength="7"
> minRequiredNonalphanumericCharacters="1"
> maxInvalidPasswordAttempts="5"
> passwordAttemptWindow="5"
> passwordFormat="Hashed"
> enablePasswordRetrieval="false"
> enablePasswordReset="true"/>
> </providers>
> </membership>
> Here is some more info:
> http://weblogs.asp.net/fmarguerie/a...tion-files.aspx
> Hope this helps,
>
> Steve
> "Blasting Cap" <goober@.christian.net> wrote in message
> news:eqYkXt4pHHA.1216@.TK2MSFTNGP03.phx.gbl...
>
re:
!> I want to be able to use a separate config file on, in addition to
!> the web.config file that's already working in the application.
To use a separate config file for the appsettings section of web.config, use
:
<appSettings configSource="somefile.config"/>
To enable the configuration to be recognized on any change to "somefile.conf
ig",
edit machine.config, in the <configSections> section, and edit <section name
="appSettings" ... >,
adding : restartOnExternalChanges="true"
That'd make it :
<section name="appSettings" type="System.Configuration.AppSettingsSection, S
ystem.Configuration,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOn
ExternalChanges="true"
requirePermission="false" />
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Blasting Cap" <goober@.christian.net> wrote in message news:eqYkXt4pHHA.1216@.TK2MSFTNGP03.p
hx.gbl...
> I am working on a web app that I want to be able to use a separate config
file on, in addition to
> the web.config file that's already working in the application.
> If I put the following in the web.config file (VS 2005, Framework 2.0), I
can retrieve the values
> fine:
> <appSettings>
> <add key="fileInputFolder" value="C:\National City Downloads\test"/>
> <add key="fileTransaction" value="\Transactions\"/>
> <add key="TimerInterval" value="20000"/>
> <add key="Conn" value ="Data Source=dellserver\sql2000;Initial Catalog
=CIC_BankModel;Persist
> Security Info=True;User ID=sa;Password=adminsql"/>
> </appSettings>
> I retrieve the value with this line in the codefile in one of the apps on
the page:
> Session("MyExchangeServer") = WebConfigurationManager.AppSettings("fileInp
utFolder").ToString
> The placement of the above appsettings line is right after the </system.we
b> in the web.config
> file, and immediately before the <system.net> line.
> Any of those values can be read with no problem if they're in the web.conf
ig file.
> I added a new item to my project, app.config.
> It looks like this:
> <?xml version="1.0"?>
> <!--
> Note: As an alternative to hand editing this file you can use the
> web admin tool to configure settings for your application. Use
> the Website->Asp.Net Configuration option in Visual Studio.
> A full list of settings and comments can be found in
> machine.config.comments usually located in
> \Windows\Microsoft.Net\Framework\v2.x\Config
> -->
> <configuration>
> <appSettings>
> <add key="fileInputFolder" value="C:\National City Downloads\test"/>
> <add key="fileTransaction" value="\Transactions\"/>
> <add key="TimerInterval" value="20000"/>
> <add key="Conn" value ="Data Source=dellserver\sql2000;Initial Catalog
=CIC_BankModel;Persist
> Security Info=True;User ID=sa;Password=adminsql"/>
> </appSettings>
> <connectionStrings/>
> <system.web>
> <!--
> Set compilation debug="true" to insert debugging
> symbols into the compiled page. Because this
> affects performance, set this value to true only
> during development.
> -->
> <compilation debug="false" />
> <!--
> The <authentication> section enables configuration
> of the security authentication mode used by
> ASP.NET to identify an incoming user.
> -->
> <authentication mode="Windows" />
> <!--
> The <customErrors> section enables configuration
> of what to do if/when an unhandled error occurs
> during the execution of a request. Specifically,
> it enables developers to configure html error pages
> to be displayed in place of a error stack trace.
> <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.
htm">
> <error statusCode="403" redirect="NoAccess.htm" />
> <error statusCode="404" redirect="FileNotFound.htm" />
> </customErrors>
> -->
> </system.web>
> </configuration>
>
> It returns this message when I try to load the page.
> The format of a configSource file must be an element containing the name o
f the section.
> (C:\Inetpub\wwwroot\test\App.config line 10)
> The only thing I have changed from the original app.config file was where
appSettings was already
> in the file, in the form <appSettings/>. Where you see the <appSettings> a
nd the 3-4 lines
> followed by the </appSettings>, I simply replaced it.
> The exact error on the page is:
> Configuration Error
> Description: An error occurred during the processing of a configuration fi
le required to service
> this request. Please review the specific error details below and modify yo
ur configuration file
> appropriately.
> Parser Error Message: The format of a configSource file must be an element
containing the name of
> the section.
> Source Error:
>
> Line 8: \Windows\Microsoft.Net\Framework\v2.x\Config
> Line 9: -->
> Line 10: <configuration>
> Line 11: <appSettings>
> Line 12: <add key="fileInputFolder" value="C:\National City Downloads\
test"/>
>
> Source File: C:\Inetpub\wwwroot\test\App.config Line: 10
>
> ----
--
> Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NE
T Version:2.0.50727.210
>
> Any idea what I am doing wrong on this? I'd like to do some more with thi
s alternate config file,
> but I'm just trying to get the simple stuff to work, before I do anything
else.
> Thanks,
> BC
Thursday, March 29, 2012
Separate VB app to talk back to a Web Service
data transformation and puts the data into a special format that
another application uses. That data is in a file.
This other application continuously polls a folder for these data
files and processes them. It eventually creates a PDF out of the
data with a unique file name.
Web service needs to know when this other application is done
processing this data so I can send a URL of the created PDF back to
customer.
What would be the best way to do this? I don't want to sit there and
poll a folder for the output file, as we may have up to 40,000
requests / day.look at windows workflow or sqlserver broker services.
-- bruce (sqlwork.com)
"Larry Bud" wrote:
> Customer sends XML data to our Web Service. Web Service does some
> data transformation and puts the data into a special format that
> another application uses. That data is in a file.
> This other application continuously polls a folder for these data
> files and processes them. It eventually creates a PDF out of the
> data with a unique file name.
> Web service needs to know when this other application is done
> processing this data so I can send a URL of the created PDF back to
> customer.
> What would be the best way to do this? I don't want to sit there and
> poll a folder for the output file, as we may have up to 40,000
> requests / day.
>
In addition to Bruce's suggestion - what I have done in the past is have a
method that allows the client to check a DB value against each created file
using the number they are given on submission. For me it was word files
converted to PDF and a succesful creation triggered a DB update and then
stored the output URL - cleaning up after a 24 hour period. Because its
only a small request with a single return value it was cheap for the client
to check the webservice for a success flag and then get the URL. This
didn't massively impact throughput and could be hosted on a different app
server entirely.
Regards
John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"bruce barker" <brucebarker@.discussions.microsoft.com> wrote in message
news:7BFFAD45-86AA-48B5-AFB1-42DB21056491@.microsoft.com...
> look at windows workflow or sqlserver broker services.
> -- bruce (sqlwork.com)
>
> "Larry Bud" wrote:
>
On Feb 11, 4:37=A0pm, "John Timney \(MVP\)"
<xyz_j...@.timney.eclipse.co.uk> wrote:
> In addition to Bruce's suggestion - what I have done in the past is have a=[/color
]
> method that allows the client to check a DB value against each created fil=[/color
]
e
> using the number they are given on submission. =A0For me it was word files=[/color
]
> converted to PDF and a succesful creation triggered a DB update and then
> stored the output URL - cleaning up after a 24 hour period. =A0Because its=[/color
]
> only a small request with a single return value it was cheap for the clien=[/color
]
t
> to check the webservice for a success flag and then get the URL. =A0This
> didn't massively impact throughput and could be hosted on a different app
> server entirely.
>
Wouldn't you have to keep hitting the database to see if the file was
created successfully?
Yes, but it doesn't have to be the same database, or even the same database
server!
Regards
John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"Larry Bud" <larrybud2002@.yahoo.com> wrote in message
news:e2449b23-38af-4876-88c5-df0f10f77278@.s8g2000prg.googlegroups.com...
On Feb 11, 4:37 pm, "John Timney \(MVP\)"
<xyz_j...@.timney.eclipse.co.uk> wrote:
> In addition to Bruce's suggestion - what I have done in the past is have a
> method that allows the client to check a DB value against each created
> file
> using the number they are given on submission. For me it was word files
> converted to PDF and a succesful creation triggered a DB update and then
> stored the output URL - cleaning up after a 24 hour period. Because its
> only a small request with a single return value it was cheap for the
> client
> to check the webservice for a success flag and then get the URL. This
> didn't massively impact throughput and could be hosted on a different app
> server entirely.
>
Wouldn't you have to keep hitting the database to see if the file was
created successfully?
Separate Webserver and SQL Server -- error when connecting asp.net app to a datab
news:O8EQVObPFHA.2604@dotnet.itags.org.TK2MSFTNGP10.phx.gbl...
> Please help! I would really appreciate it!!
1) Are you using the native .NET data provider, OleDb or (surely not!) ODBC?
2) What ConnectionString are you using?
3) When you installed SQL Server, what authentication mode did you choose
(SQL Server, Windows or mixed)?
4) On the SQL Server machine, launch SQL Query Analyzer (NOT ENTERPRISE
MANAGER!) and try to log in using the UserID and password from the
ConnectionString in 2) above - can you? If so, can you drop the database
dropdown and select the database from the ConnectionString in 2) above? If
so, run SELECT * FROM sysobjects - what do you see?"Ann Marinas" <ka_marinas@.xtra.co.nz> wrote in message
news:erPYsrbPFHA.3336@.TK2MSFTNGP09.phx.gbl...
Ann,
> 1) I am using System.Data.SqlClient for my data access.
That's a good thing.
> 2) I have changed the connection string which was located in my web.config
> file when we separated the webserver to the sql db server
I'm sure you have but, if we're going to help you, you're going to have to
tell us what the ConnectionString is... :-)
> 3) The authenticatio is set to Mixed mode -- SQL Server and Windows
> Authentication
Even easier.
> 4) On the Webserver, the Query Analyzer is not installed on the webserver.
> However if I am going to access the query analyzer, I have to access the
> sql server itself.
No - just use any machine which can "see" the SQL Server and which has the
SQL Client Tools installed.
seperate bthe dll from a project working on multiple dlls
Hi ya,
i am working on a project which includes dll's of many projects
Now i want to seperate my app , because whenever a change is made in any of the included project , i have to recompile my project.
so can anyone suggest me ....how to seperate my application.
Thanks
one Solution file for One Project file is probably the best way to do it.
But maybe i dont understand you properly.
if you have one project, and you reference say, 5 .dll files from other projects. When those projects change, all you have to do is re-compile them, your project that references those ones should not need to be re-compilled, just the new .dll should overwrite the old one.
Creating a Solution with Project Dependancies can also simplify the process, that way if you need to mod a .dll your referencing, you already have the project in your solution.
HTH,
mcm
Monday, March 26, 2012
Sequential numbers without a database?
I'd building an app that posts to a web service. One of the things
that is required in the soap header is a sequential number appended to
a ref, i.e. "IGI1001", "IGI1002", etc.
Obviously the first part of the reference ("IGI") stays the same, but
I need an incrementing number generated. Now, I was thinking of doing
this via a SQL database, but it would be an awful waste as there would
only be one table and one stored procedure in it. Then I was thinking
of putting it in an application variable: it would be read from a file
at the application start, incremented through the life of the
application, then written back to the file at application end. I
quickly discounted that in case the new number didn't get written back
to the file for whatever reason.
Incidentally, the web service expects the caller to provide the
incrementing alpha-numeric reference, so it won't be done at the web
service.
Any thoughts?
Kind regards,
Mike KingscottHallo Mike
"Mike Kingscott" <mike@.kingscott.f9.co.uk> schrieb im Newsbeitrag
news:7d9b584d.0407010225.3365dc16@.posting.google.c om...
> Hi all,
> I'd building an app that posts to a web service. One of the things
> that is required in the soap header is a sequential number appended to
> a ref, i.e. "IGI1001", "IGI1002", etc.
> Obviously the first part of the reference ("IGI") stays the same, but
> I need an incrementing number generated. Now, I was thinking of doing
> this via a SQL database, but it would be an awful waste as there would
> only be one table and one stored procedure in it. Then I was thinking
> of putting it in an application variable: it would be read from a file
> at the application start, incremented through the life of the
> application, then written back to the file at application end. I
> quickly discounted that in case the new number didn't get written back
> to the file for whatever reason.
> Incidentally, the web service expects the caller to provide the
> incrementing alpha-numeric reference, so it won't be done at the web
> service.
> Any thoughts?
> Kind regards,
> Mike Kingscott
I think, wether it is a waste, to use a sql database. its the safest way to
ensure there is always an incremented number.
regards benni
Any chance you could use a timestamp, or a GUID in the headers to make
them unique? Or does it absolutely have to be a sequential number?
Perhaps you could use a combination of incremented number and a
TimeStamp. The TimeStamp could be the time at which the application
started, say with DateTime.Now.Ticks. The sequential ID could then be
a static field that you increment with the Interlocked.Increment
method.
Possible?
--
Scott
http://www.OdeToCode.com
On 1 Jul 2004 03:25:58 -0700, mike@.kingscott.f9.co.uk (Mike Kingscott)
wrote:
>Hi all,
>I'd building an app that posts to a web service. One of the things
>that is required in the soap header is a sequential number appended to
>a ref, i.e. "IGI1001", "IGI1002", etc.
>Obviously the first part of the reference ("IGI") stays the same, but
>I need an incrementing number generated. Now, I was thinking of doing
>this via a SQL database, but it would be an awful waste as there would
>only be one table and one stored procedure in it. Then I was thinking
>of putting it in an application variable: it would be read from a file
>at the application start, incremented through the life of the
>application, then written back to the file at application end. I
>quickly discounted that in case the new number didn't get written back
>to the file for whatever reason.
>Incidentally, the web service expects the caller to provide the
>incrementing alpha-numeric reference, so it won't be done at the web
>service.
>Any thoughts?
>Kind regards,
>Mike Kingscott
Sequential numbers without a database?
I'd building an app that posts to a web service. One of the things
that is required in the soap header is a sequential number appended to
a ref, i.e. "IGI1001", "IGI1002", etc.
Obviously the first part of the reference ("IGI") stays the same, but
I need an incrementing number generated. Now, I was thinking of doing
this via a SQL database, but it would be an awful waste as there would
only be one table and one stored procedure in it. Then I was thinking
of putting it in an application variable: it would be read from a file
at the application start, incremented through the life of the
application, then written back to the file at application end. I
quickly discounted that in case the new number didn't get written back
to the file for whatever reason.
Incidentally, the web service expects the caller to provide the
incrementing alpha-numeric reference, so it won't be done at the web
service.
Any thoughts?
Kind regards,
Mike KingscottHallo Mike
"Mike Kingscott" <mike@.kingscott.f9.co.uk> schrieb im Newsbeitrag
news:7d9b584d.0407010225.3365dc16@.posting.google.com...
> Hi all,
> I'd building an app that posts to a web service. One of the things
> that is required in the soap header is a sequential number appended to
> a ref, i.e. "IGI1001", "IGI1002", etc.
> Obviously the first part of the reference ("IGI") stays the same, but
> I need an incrementing number generated. Now, I was thinking of doing
> this via a SQL database, but it would be an awful waste as there would
> only be one table and one stored procedure in it. Then I was thinking
> of putting it in an application variable: it would be read from a file
> at the application start, incremented through the life of the
> application, then written back to the file at application end. I
> quickly discounted that in case the new number didn't get written back
> to the file for whatever reason.
> Incidentally, the web service expects the caller to provide the
> incrementing alpha-numeric reference, so it won't be done at the web
> service.
> Any thoughts?
> Kind regards,
> Mike Kingscott
I think, wether it is a waste, to use a sql database. its the safest way to
ensure there is always an incremented number.
regards benni
Any chance you could use a timestamp, or a GUID in the headers to make
them unique? Or does it absolutely have to be a sequential number?
Perhaps you could use a combination of incremented number and a
TimeStamp. The TimeStamp could be the time at which the application
started, say with DateTime.Now.Ticks. The sequential ID could then be
a static field that you increment with the Interlocked.Increment
method.
Possible?
Scott
http://www.OdeToCode.com
On 1 Jul 2004 03:25:58 -0700, mike@.kingscott.f9.co.uk (Mike Kingscott)
wrote:
>Hi all,
>I'd building an app that posts to a web service. One of the things
>that is required in the soap header is a sequential number appended to
>a ref, i.e. "IGI1001", "IGI1002", etc.
>Obviously the first part of the reference ("IGI") stays the same, but
>I need an incrementing number generated. Now, I was thinking of doing
>this via a SQL database, but it would be an awful waste as there would
>only be one table and one stored procedure in it. Then I was thinking
>of putting it in an application variable: it would be read from a file
>at the application start, incremented through the life of the
>application, then written back to the file at application end. I
>quickly discounted that in case the new number didn't get written back
>to the file for whatever reason.
>Incidentally, the web service expects the caller to provide the
>incrementing alpha-numeric reference, so it won't be done at the web
>service.
>Any thoughts?
>Kind regards,
>Mike Kingscott
Saturday, March 24, 2012
Serialization/Deserialization or XML as DB
temp DB
What is the fastest way to do serialization/deserialization?
or maybe the better question would be how to efficiently
retrieve/save data to an xml file.
have tried deserializing from XML file but having a hard time on
mulitple records...
sample codes would be nice :)
thanksThe fastest way is to use a dataset. You can use ds.WriteXml and ds.ReadXml
quite easily.
Private Sub WriteXmlToFile(thisDataSet As DataSet)
If thisDataSet Is Nothing Then
Return
End If
' Create a file name to write to.
Dim filename As String = "myXmlDoc.xml"
' Create the FileStream to write with.
Dim myFileStream As New System.IO.FileStream _
(filename, System.IO.FileMode.Create)
' Create an XmlTextWriter with the fileStream.
Dim myXmlWriter As New System.Xml.XmlTextWriter _
(myFileStream, System.Text.Encoding.Unicode)
' Write to the file with the WriteXml method.
thisDataSet.WriteXml(myXmlWriter)
myXmlWriter.Close()
End Sub
http://msdn.microsoft.com/library/d...iteXmlTopic.asp
<umbertoeklat@.yahoo.com> wrote in message
news:40a017dd.6118157@.news.microsoft.com...
> as a proof of concept, am trying create a web app w/ an XML file as a
> temp DB
> What is the fastest way to do serialization/deserialization?
> or maybe the better question would be how to efficiently
> retrieve/save data to an xml file.
> have tried deserializing from XML file but having a hard time on
> mulitple records...
>
> sample codes would be nice :)
> thanks
Hi,
XML/web service sounds fantastic, but it is truely very very bad from
the view of performance. As long as you consider your application
performance, you should never use it under any cases. It is always bad to
serialize or deserialize a large data in XML format using disk, memory,
network or whatever. See the article entitled as Performance comparison
between SocketPro and dotNet remoting at
http://www.udaparts.com/articles/fastsocketpro.htm
DON'T USE XML/WEB SERVICE AS LONG AS YOU CONSIDER PERFORMANCE!
--
Yuancai (Charlie) Ye
Fast and securely accessing all of remote data sources anywhere with
SocketPro using batch/queue, asynchrony and parallel computation
See 30 well-tested and real OLEDB examples
RDB, a tool for fast and securely accessing remote databases with dial-up,
cable, DSL and wireless modems anywhere
www.udaparts.com
<umbertoeklat@.yahoo.com> wrote in message
news:40a017dd.6118157@.news.microsoft.com...
> as a proof of concept, am trying create a web app w/ an XML file as a
> temp DB
> What is the fastest way to do serialization/deserialization?
> or maybe the better question would be how to efficiently
> retrieve/save data to an xml file.
> have tried deserializing from XML file but having a hard time on
> mulitple records...
>
> sample codes would be nice :)
> thanks
Ok first of all, I think we are talking about persistence, not
serialization.
Imagine you filling a bucket with a hose. The process of the water moving
thru the hose is called as serialization, and the filling of the bucket is
called as "Persistence".
Anyway, the fastest way to do persistence, I feel is to create a class that
represents your data. The class is marked [Serializable]. Then use Binary
formatter to Serialize it to a memory-mapped file. A memory mapped file is
what in short the OS will take care of persistence, but it stays in RAM, so
it's ultra fast. (and easy to implement too). Now if this were a web
application, you could use advanced techniques like caching (asp.net), or
object pooling (COM interop), to get even better performance benefit. ...
man this is getting exciting as we go :).
See - thats the catch, Your proof of concept doesn't need to do XML
persistence, because Binary would be SO MUCH quicker, and then you could
obviously set [xmlelement] on each of the class's public properties, to
convert it to xml using XMLSerialization*.*, which might I add is entirely
different from BinaryFormatter, and SoapFormatter, and easily within memory
convert it to XML - should you need it - though once you have represented
your data as a serializable class - I see no need to involve XML here :).
- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/
<umbertoeklat@.yahoo.com> wrote in message
news:40a017dd.6118157@.news.microsoft.com...
> as a proof of concept, am trying create a web app w/ an XML file as a
> temp DB
> What is the fastest way to do serialization/deserialization?
> or maybe the better question would be how to efficiently
> retrieve/save data to an xml file.
> have tried deserializing from XML file but having a hard time on
> mulitple records...
>
> sample codes would be nice :)
> thanks
Tuesday, March 13, 2012
Server App Unavailable error
i notices the following in the even logs
"aspnet_wp.exe could not be launched because the username and/or password
supplied in the processModel section of the config file are invalid."
what could be possibly wrong?
i didn't change anything in the machine.confirg and the application was
running well all the time
ThanksSeems that after installing the new Service packs of .NET framework, this is happening to many folks. You might want to google for the error message and SP. I am thinking you might find the problem.
Oh BTW: Make sure that the username/password does work. :)
--
Girish Bharadwaj
http://msmvps.com/gbvb
> I have the server application unavailable error, after checking the
> event log i notices the following in the even logs
> "aspnet_wp.exe could not be launched because the username and/or
> password supplied in the processModel section of the config file are
> invalid."
> what could be possibly wrong?
> i didn't change anything in the machine.confirg and the application
> was
> running well all the time
> Thanks
Server App Unavailable error
g
i notices the following in the even logs
"aspnet_wp.exe could not be launched because the username and/or password
supplied in the processModel section of the config file are invalid."
what could be possibly wrong?
i didn't change anything in the machine.confirg and the application was
running well all the time
ThanksSeems that after installing the new Service packs of .NET framework, this is
happening to many folks. You might want to google for the error message and
SP. I am thinking you might find the problem.
Oh BTW: Make sure that the username/password does work. :)
Girish Bharadwaj
http://msmvps.com/gbvb
> I have the server application unavailable error, after checking the
> event log i notices the following in the even logs
> "aspnet_wp.exe could not be launched because the username and/or
> password supplied in the processModel section of the config file are
> invalid."
> what could be possibly wrong?
> i didn't change anything in the machine.confirg and the application
> was
> running well all the time
> Thanks
>
Server App Unavailable Error
The error says to reference the system logs for a detailed description of the failure. When looking at the Event Viewer on the server the following error shows up:
"aspnet_wp.exe could not be launched because the username and/or password supplied in the processModel section of the config file are invalid"
I'm new to asp.net. Does anyone have any insight as to why this is happening?
Thanks in advance.http://support.microsoft.com/default.aspx?scid=kb;en-us;q315158&
CAUSE
By default, ASP.NET runs its worker process (Aspnet_wp.exe) with a weak account (the local machine account, which is named ASPNET) to provide a more secure environment. On a domain controller or on a backup domain controller, all user accounts are domain accounts and are not local machine accounts. Therefore, Aspnet_wp.exe fails to start because it cannot find a local account named "localmachinename\ASPNET". To provide a valid user account on the domain controller, you must specify an explicit account in the <processModel> section of the Machine.config file, or you must use the SYSTEM account.
etc.
Server Application Unavailable
I'm running Win 2003 Server with IIS 6.0 and .Net 1.1 Framework.
Each time I try to access the app from a browser i get the following error.
----------------------------
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
----------------------------
Here's a entry from this mornings log file. It refers to the page I'm trying to access.
----------------------------
2004-08-18 10:02:14 10.1.5.242 GET /ConcoWebAppX/SiteContacts.aspx SiteID=1268 80 - 10.1.5.242 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+.NET+CLR+1.1.4322) 500 0 0
----------------------------
I have security set to the local IUSR_MACHINENAME account from the root down, the Authenticated Access has been tried with both Integrated Windows Authentication and nothing checked.
The Execute Permissions under the Home Directory is set to scripts only.
I'm really at a loss.
Can anyone steer me in the right direction for an answer as well as a best practice?
Thanks.
Doug DexterDid you try removing all code from the page and re-running it to ensure that it is not a coding error (for example a never ending loop)?
The code runs in development, and has even run on this 2003 server and there are several .Net pages affected by this, not just the example I've shown.
So I'm certain it's a permission issue.
Thanks.
does it involve database ?
Yes.
This thing is driving me CRAZY...
It works on XP PRO...
But it REFUSES to run on Server 2003...
Hasn't SOMEONE had this problem?
FIXED.
In the web.config file set the following:
<authorization>
<allow users="*" /> <!-- Allow all users --
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>
John 3:16
dd
Server Application Unavailable
Is this error an alias for some other problem? The error is the same with friendly messages on or off.
The MSFT site says to edit the processModel section of machine.config, but that did not work. At any rate, yesterday when prog was working, processModel was commented out, as it still was today. I have never messed with ASPNET user account.
Both my web server computer and development computer have both ASP.NET 1.1 and Studio.Net 2003 installed, & both have developed this problem, almost at the same time. They are not connected via any network, though.
At any rate, I don't think the problem can be machine.config; it has not changed. Are there "correct" settings for the ASPNET user account? I've never set any password. Is there some default which can be changed? Any help would be greatly appreciated.
Many thanks
Mike Thomas
Take a look in the Event Log. The error should be logged there.
HTH,
Ryan
Server Application Unavailable
I have a ASP.NET application written in C#.
I connect this app with a 4th Dimension database via ODBC.
My problem is that when i try to fill a dataset and the query dont return
any data, I get an "Server Application Unavailable"-error.
Is there a way to catch this error? Ive tried with try/catch,
application_error in global.asax and CustomErrors="On"
defaultRedirect="errorpage.aspx" but none of those can handle this error.
Does anyone knows something about this?
/MarreHi Marre,
Do you have access to the event log on this machine? That error usually
writes useful information to the event log.
"MA" <news@..removethis.supremelink.se> wrote in message
news:36edkkF4vg6l3U1@.individual.net...
> Hi all!
> I have a ASP.NET application written in C#.
> I connect this app with a 4th Dimension database via ODBC.
> My problem is that when i try to fill a dataset and the query dont return
> any data, I get an "Server Application Unavailable"-error.
>
> Is there a way to catch this error? Ive tried with try/catch,
> application_error in global.asax and CustomErrors="On"
> defaultRedirect="errorpage.aspx" but none of those can handle this error.
> Does anyone knows something about this?
> /Marre
>