Thursday, March 29, 2012
Please evaluate C# code - Beginner level
In order to expand my knowledge, my goal is to write a class that will encapsulate this code. I understand that writing a class for my tiny website may be a bit excessive, but its more for the knowledge of "how-to" than practicality.
The class that I have written does somewhat work:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.Sql;
public class Database
{
private String DatabaseConnectionString = "Data source=*;" +
"Database=*;" +
"uid=*;" +
"pwd=*";
private SqlConnection objConnection;
private SqlCommand objCommand;
public SqlDataReader objReader;
public String dbError;
public String GetConnectionString()
{
return DatabaseConnectionString;
}
private SqlConnection CreateConnection()
{
SqlConnection objConnection = new SqlConnection(DatabaseConnectionString);
return objConnection;
}
private SqlCommand CreateCommand(String p_Command, SqlConnection p_Connection)
{
SqlCommand objCommand = new SqlCommand(p_Command, p_Connection);
return objCommand;
}
//Article Related
public void GetArticleByID(String p_CategoryID, String p_ArticleID)
{
objConnection = CreateConnection();
objCommand = CreateCommand("SELECT * FROM tblArticle " +
"WHERE tblArticle.charArticleID=@dotnet.itags.org.Article " +
"AND tblArticle.charCategoryID=@dotnet.itags.org.Category", objConnection);
SqlDataReader objReader;
try
{
objConnection.Open();
objCommand.Parameters.AddWithValue("@dotnet.itags.org.Article",p_ArticleID);
objCommand.Parameters.AddWithValue("@dotnet.itags.org.Category",p_CategoryID);
objReader = objCommand.ExecuteReader();
}
catch(System.Exception ex)
{
dbError = ex.Message;
objReader= null;
}
}
//End Articles
}
The class is used like this:
<script runat="server" language="c#">
protected void Page_Load(Object sender, EventArgs e)
{
String strCategoryID = Request.QueryString["ci"];
String strArticleID = Request.QueryString["ai"];
Database objDatabase = new Database();
objDatabase.GetArticleByID(strCategoryID,strArticleID);
if(objDatabase.objReader != null)
{
while(objDatabase.objReader.Read());
{
label1.Text += objDatabase.objReader["charTitle"].ToString();
}
}
else
label1.Text = objDatabase.dbError;
}
</script>
Question 1: Is my method even correct? Am I taking the right approach to this?
I'm trying to create shortcuts by making functions that create the connectionstring and command for me without me having to type it out each time. The idea behind the class is that, it will do all the work for me and store a SqlDataReader object in itself, that I will then manipulate in my Page_Load event.
Any input in regards to this question is greatly appreciated. Thanks!What you've created is called a DAL - Data Access Layer. It's a class which encapsulates the database-specific methods. You're doing fine. Your approach is right, but the datareader isn't required here. In addition, your GetArticleById method is returning void. So, you need to make it return a dataset, and change its function signature to return a dataset.
In the code that calls this method, assign a dataset to the method, and use that dataset to... whatever.
when is it best to use the DataAdapter/DataSet approach and when is it best to use a DataReader?
I mean the DataAdapter/DataSet just seems like the long way instead of just using a DataReader.
It depends on what you need... if you need to get some records, manipulate the data in memory and then send the changes back, a DataSet/Table would be the candidate. But if you are doing something like filling a combobox, then a Reader is ideal. Any time you need to loop through the data quickly and use it for something other than modifying the data, odds are, a reader will suffice. They come at a small price: 1) they create an exclusive lock on the connection, meaning you cannot use it for anything else. If you need to connect to do another db operation, a second connection will be needed. 2) They are read-only and forward only. You can't change the data and cannot move backwards in the data. But that's also where thier power comes from. By being what's called a Firehose cursor, it is very fast and efficient.
-tg
awesome... that is great to know, thanks tg!
I'll add to that. In a situation when you need to work with and update a very, very, very large set of data, do not use a dataset. Instead, use a datareader, and use separate code for the database manipulation.
Mendhak & TechGnome,
Thanks so much for the reply. Your opinions are appreciated!
In addition, your GetArticleById method is returning void.
This is true. I actually changed the code without making the correct change in my question. Instead of returning something, I attached the Datareader to the object itself.
Instead of doing:
DataReader MyObject = GetArticleByID(X,Y)
I am manipulating the DataReader as part of the object:
objDatabase.DataReader
I think this is the best way to do it. I will update my initial post.
but the datareader isn't required here
I guess I'm a little confused about what TechGnome said.
t depends on what you need... if you need to get some records, manipulate the data in memory and then send the changes back, a DataSet/Table would be the candidate. But if you are doing something like filling a combobox, then a Reader is ideal.
Since in the example I am only getting one article, its title, and the picture that is associated with it, would a DataReader not be the best? I only need a read only connection that retrieves data, I do not manipulate it in any way.
It seems to me that the dataset would be more appropriate for functions that modify the data such as:
AddNewArticle(X,Y);
EditArticle(X,Y);
Thanks again for the replies.
Actualy if all you are returning is a single record... you should look into using output parameters and use the ExecuteNonQuery method.
-tg
Since in the example I am only getting one article, its title, and the picture that is associated with it, would a DataReader not be the best?
Nope. A dataset would be ideal here. You have a chunk of text, a string, and an image. You are not moving anywhere within the data. So, you need a dataset.
Have your method GetArticleById() return a dataset.
Got it, thanks for the replies all. I will use a DataSet!
Please explain what "Empty path has no directory" means with Server.MapPath
I have the following line of code in a script...
litMsg.Text = Server.MapPath("/");
where litMsg is an ASP.Net Literal control. When I try and run this
page, I get the error ...
System.ArgumentException: Empty path has no directory.
Anyone any idea what this means? I have used Server.MapPath many times
before without error, I'm not sure why it suddenly stopped working here.
I'm sure I'm missing something blindingly obvious and would be grateful
if anyone could point it out!! TIA.
--
Alan Silver
(anything added below this line is nothing to do with me)IN case it's of any use to anyone, I found out that the problem was
caused by me having the following two lines in Page_Load...
HttpContext myContext = HttpContext.Current;
myContext.RewritePath("/");
I'm not actually sure *why* I had those lines there, they must have been
from something I was doing before. As soon as I removed them, the
Server.MapPath worked fine.
If anyone has an explanation, I would like to hear it ;-)
>Hello,
>I have the following line of code in a script...
>litMsg.Text = Server.MapPath("/");
>where litMsg is an ASP.Net Literal control. When I try and run this
>page, I get the error ...
>System.ArgumentException: Empty path has no directory.
>Anyone any idea what this means? I have used Server.MapPath many times
>before without error, I'm not sure why it suddenly stopped working here.
>I'm sure I'm missing something blindingly obvious and would be grateful
>if anyone could point it out!! TIA.
--
Alan Silver
(anything added below this line is nothing to do with me)
Monday, March 26, 2012
Please Help
I have created one webform1.aspx page on local server (c:\inetpub\wwwroot\mysite\prabodh). it executes without any error. when I upload prabodh folder on the main server in (E:\mysite\prabodh) and i have set the properties for this folder.
Now I am getting the following error when i am trying to access the file from my remote machine.
the error is :
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration
when i am trying to access same file from the main server then .
the error is :
Server Error in '/prabodh' Application.
------------------------
Server cannot access application directory 'E:\web\mysite\prabodh\'. The directory does not exist or is not accessible because of security settings.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Server cannot access application directory 'E:\web\mysite\prabodh\'. The directory does not exist or is not accessible because of security settings.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Server cannot access application directory 'E:\web\mysite\prabodh\'. The directory does not exist or is not accessible because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263
[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +965
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128
------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
dotnet framwork is installed on the server and web.config file
is also there in the root folder of the application.
And I Gave the local user ASPNET read/excecute permissions to your application directory (E:\web\mysite\prabodh\).
I also made sure that the directory is defined as an application in IIS
can any one tell me why i am getting this message.
Thnx in advance.
Jean PaulAre you sure that you're running with the ASPNET user?
no iam not sure
Please help - Client/Server communication with VB.Net/ASP
another computer for testing.
On the "host" computer I have installed IIS and used VB.Net to create an
HTML member in the c:\ root directory called Index.htm. This module is a
simple "Hello World" HTML file. This machine is connected to the internet
and has a static IP address.
On the "Client" computer I enter the IP address of the host (with or without
"\Index.htm") on the Address line of IE6 and press enter.
I should then see my "Hello World" file, right? Well, I get "This page
cannot be displayed". What am I missing??
Thanks in advance,
JohnHi John,
I think you should put the Index.htm under wwwroot folder. By default, it is
the "c:\inetpub\wwwroot" folder.
--
Regards,
Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
"John Howard" <john_howard@.dcf.state.fl.us> wrote in message
news:3ffea1e2$1@.news.hcs.net...
> I am writing my first VB.Net ASP application and would like to set up
> another computer for testing.
> On the "host" computer I have installed IIS and used VB.Net to create an
> HTML member in the c:\ root directory called Index.htm. This module is a
> simple "Hello World" HTML file. This machine is connected to the internet
> and has a static IP address.
> On the "Client" computer I enter the IP address of the host (with or
without
> "\Index.htm") on the Address line of IE6 and press enter.
> I should then see my "Hello World" file, right? Well, I get "This page
> cannot be displayed". What am I missing??
> Thanks in advance,
> John
Please help - very simple question.
<SCRIPT runat="server">.
The browser (IE6) gives me an error stating Expected ";" on line 3
<FULL CODE BELOW>
==========================================================
<%@dotnet.itags.org. Page Language="VB" %>
<script runat="server"
Sub Button1_Click(sender As Object, e As EventArgs)
Label1.Text = "Hello " & TextBox1.Text & " you selected: " & Calendar1.SelectedDate
End Sub</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<asp:Label id="Label1" runat="server">Label</asp:Label>
</p>
<p>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button>
</p>
<!-- Insert content here -->
</form>
</body>
</html>
=======================================END CODE==========
Please help
MikeDo you have ASP.NET installed on the server? Have you named the page with an .aspx extension?
Yes. the page is named with an .aspx extension.
I am using the same machine to test as I am to write the code. I have the .Net v 1.1 Framework installed on this same machine. I was under the impression that all I need to start is the .Netv1.1 and I am using the webmatrix to develop with.
Could it be something with the virtual path created in the Webmatrix that does not have the proper ASPNET permissions?
OK. This is an error in the browser, correct? If you look in th source code (View/Source) is the script block in the rendered HTML? If so, then ASP.NET is not registered correctly in the folder where you are running from.
Is the folder registered in IIS?
Yes, you can see the <SCRIPT> blocks as you see the code as in my first post!
In IIS there is a virtual folder called "Testing." from which my newfile.aspx is located.
Properties of Testing are:
Virtual Directory properties are to a path on my local machine.
D&S/A/My Docs/... with Read/Log/& index. Execute Permissions = Scripts only
When I look at the config button for the app mappings, I only see asp.dll . Is there not an aspx.dll or something similar? I bet this is my problem. Why not installed when I either installed .NETv1.1 or webmatrix? This should be easy.
Again, I am not sure what you mean by registered in IIS. Is there a .dll that may not be registered, or configured in IIS? How can I check to see if IIS installation will process .NETv1.1 correctly.
Again, the error occures at the browser stating - Expected ";" at any <SCRIPT runat="server"> line.
Thanks Again. Mike
You need to go to the IIS application (Control Panel/Administrative Tools/Internet Information Services or similar) and make sure that the folder you are using is set up as a virtual directory.
See below==============from prior post.
In IIS there is a virtual folder called "Testing." from which my newfile.aspx is located.
Properties of Testing are:
Virtual Directory properties are to a path on my local machine.
D&S/A/My Docs/... with Read/Log/& index. Execute Permissions = Scripts only
If I click on the Configuration button, and on the App Mappings tab, I do not see a .dll for ASP.NET like I do for the old asp (asp.dll)
Is there suppost to be a aspx.dll (or some .Net dll to drive an .aspx web site)? And if so, should it show up in this location...
After much research, I have discovered what the issue was.
In IIS under the Virtural Directory properties page:
and after clicking on the configuration button, I discovered that there were was not a setting for .aspx extension. I added the aspnet_isapi.dll to the list and once I ran the test page it worked!
Wow, I cannot belive that I was the only one to have this problem. I have not read anywhere that a user would have to manually apply this .dll to the app mappings tab in order to display an .aspx page!
Thank You.
Mike Griggs
You would virtually never manually add the DLL (and this likely will not completely fix all problems - if you only associated ASPX, ASMX files (Web Services) will likely not work.
Commonly, running aspnet_regiis -i is what folks do to get the folder set up correctly. This often is caused by installing IIS after installing ASP.NET.
I think what may have happened is that I tried to install the dotnetfx.exe file BEFORE installing the .NET Framework. I did uninstall and then reinstall each componet:
.NET Framework v1.1 then
.NET Framework Version 1.1 Redistributable Package
I did notice that during the redist process that aspnet_regiis -i did run. However, I manually added the DLL prior to re-running the redist package. (However, I did not check this prior to uninstalling the two) I dont know if the package added the DLL to the configuration tab or not. I think that I am good on this issue for now...I am now able to run my simple Hello World aspx after hours of trying...
Now I am ready to get started. Watch Out...Mike
Please help - What am I missing?
to work. Thanks for any help.
Server Application Unavailable
Regards,
CK"Chris Kettenbach" <chris@.piasd.org> wrote in message
news:JJ6dnSXFSdcPSB_cRVn-sw@.giganews.com...
> Why are my ASP.NET apps giving me this message? I am unable to get
anything
> to work. Thanks for any help.
> Server Application Unavailable
I've had this problem when I copied application files to the server using
Web-based remote administration tool. And the issue was with file system
access rights. As soon as I allowed ASPNET to read from the directory,
problem was fixed. Try to look in that direction...
Regards,
Dmitry
Check out this faq to know why this error message is coming,
http://www.extremeexperts.com/Net/F...navailable.aspx
--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com
"Chris Kettenbach" <chris@.piasd.org> wrote in message
news:JJ6dnSXFSdcPSB_cRVn-sw@.giganews.com...
> Why are my ASP.NET apps giving me this message? I am unable to get
anything
> to work. Thanks for any help.
> Server Application Unavailable
> Regards,
> CK
Saturday, March 24, 2012
Please Help !
I am having the Error in ASP.Net Application.
Can you go through this and send me the solution for the Error solving feedback.
Server Error in '/WBS' Application.
------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Tariff3Tier.Frm_M_AddHotSpot.ViewHotSpotDetails()
Tariff3Tier.Frm_M_AddHotSpot.ddlHotSpotName_SelectedIndexChanged(Object sender, EventArgs e)
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26
System.Web.UI.Page.RaiseChangedEvents() +115
System.Web.UI.Page.ProcessRequestMain() +1081
------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573This is probably the most asked about error message and occurs when you are trying to use an object without instantiating it.
Make sure you have instantiated the object before referencing it in the code. If possible, please post your code here since it will be easier to identify the source of error.
We need more information ...
Please give use the code where the error happened ...
A recommendation: always check that your variables are not null !!!
Also, insert the following directive at the top of your aspx page -
<%@. Page debug="true" %>and run it again.
Please don't post all of the code just yet... The debugger is telling you the problem is happening with this event: .ddlHotSpotName_SelectedIndexChanged(Object sender, EventArgs e)
Please just post the code that is contained in that event
Please help ! Problem about HttpWebRequest - GetResponse()
I have problem when I use HttpWebRequest and take long time to call to my
service server. If at that time there are many request comes in
semultaneous, I will get this exception
System.Net.WebException: The underlying connection was closed: The request
was canceled. --> System.IO.IOException: Unable to read data from the
transport connection. --> System.ObjectDisposedException: Cannot access a
disposed object named "System.Net.TlsStream".
Object name: "System.Net.TlsStream".
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncResult result)
-- End of inner exception stack trace --
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
-- End of inner exception stack trace --
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at MFEC.DealerServices.Service.PaymentGateway.CallPaymentGateway(String
serviceName, GeneralParameterCollection inputParam)
Does anybody know how to solve this problem ?Have you seen this?
http://support.microsoft.com/defaul...kb;en-us;884537
- slightly different scenario, but you might be hitting the same bug.
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 22 Apr 2005 10:10:02 GMT, "japslam japslam via
webservertalk.com" <forum@.nospam.webservertalk.com> wrote:
>Hi all,
>I have problem when I use HttpWebRequest and take long time to call to my
>service server. If at that time there are many request comes in
>semultaneous, I will get this exception
>System.Net.WebException: The underlying connection was closed: The request
>was canceled. --> System.IO.IOException: Unable to read data from the
>transport connection. --> System.ObjectDisposedException: Cannot access a
>disposed object named "System.Net.TlsStream".
>Object name: "System.Net.TlsStream".
> at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
> at System.Net.TlsStream.AsyncReceiveComplete(IAsyncResult result)
> -- End of inner exception stack trace --
> at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
> at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
> -- End of inner exception stack trace --
> at System.Net.HttpWebRequest.CheckFinalStatus()
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
> at System.Net.HttpWebRequest.GetResponse()
> at MFEC.DealerServices.Service.PaymentGateway.CallPaymentGateway(String
>serviceName, GeneralParameterCollection inputParam)
>
>Does anybody know how to solve this problem ?
Please help ! Problem about HttpWebRequest - GetResponse()
I have problem when I use HttpWebRequest and take long time to call to my
service server. If at that time there are many request comes in
semultaneous, I will get this exception
System.Net.WebException: The underlying connection was closed: The request
was canceled. --> System.IO.IOException: Unable to read data from the
transport connection. --> System.ObjectDisposedException: Cannot access a
disposed object named "System.Net.TlsStream".
Object name: "System.Net.TlsStream".
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
-- End of inner exception stack trace --
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
-- End of inner exception stack trace --
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at MFEC.DealerServices.Service.PaymentGateway.CallPay mentGateway(String
serviceName, GeneralParameterCollection inputParam)
Does anybody know how to solve this problem ?Hi,
The problem is that your proxy is not allowing the webrequest.
Do one thing create a webproxy object with your proxy name and port and
bind it to webrequest like this.
// True is to by pass proxy for local
WebProxy proxy = new WebProxy(name:port, true);
// suppose req is HttpWebRequest object
req.Proxy = proxy;
and then user req.getResponse method to get the response.
Regards,
Angrez
Hi singh_angrez,
Thank you for your suggestion. But I can test it in next 2 day after this
weekend. After I try I will report the result again if it can solve my
problem or not
Thank you very much
Jap.
Hi singh_angrez,
Before I try your suggestion. I wanna show you about my code.
And my server architecture is like this
Web server --httprequest call to --> My service server
Actually, If my service server reponse the result to me in a short time,
everything is ok..no exception. But anytime my service server take long
time to process and send me the result.. at that time if there are many
requests from web server call to my service server, I got that exception
until my service server have a good response.
This is my code now. May be my code is not correct about HttpWebRequest
property.
//==== set ssl connection ==
ServicePointManager.CertificatePolicy = new MyPolicy();
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create
(PAYMENTGATEWAY_URL+strParam.ToString());
objRequest.Method = "GET";
//==== add new code ==
objRequest.KeepAlive = false;
objRequest.ProtocolVersion=HttpVersion.Version10;
objRequest.Proxy = System.Net.WebProxy.GetDefaultProxy(); // I use
default proxy which work well in normal time.
objRequest.AllowAutoRedirect=true;
objRequest.MaximumAutomaticRedirections=10;
objRequest.Timeout = (int) new TimeSpan(0,0,HTTPTIMEOUT)
..TotalMilliseconds; // ,HTTPTIMEOUT = 300
objRequest.UserAgent="Mozilla/3.0 (compatible; My Browser/1.0)";
//==== add new code ==
string str = null;
HttpWebResponse objResponse;
StreamReader sr = null;
try
{
objResponse = (HttpWebResponse)objRequest.GetResponse();
}
catch( Exception e)
{
EventMgmt.EventExceptionMsg("Payment Gateway-GetResponse() =>
"+e.ToString(), @."\DataAccess\PGWException");
throw new ServiceException("PGW001","HOST_UNREACHABLE",e);
}
try
{
sr = new StreamReader(objResponse.GetResponseStream());
str = sr.ReadToEnd().Replace('\n'.ToString(),"").Replace('\t'.ToString()
,"").Replace('&'.ToString(),"");
}
catch( Exception e)
{
EventMgmt.EventExceptionMsg("Payment Gateway-ReadResponseStream() =>
"+e.ToString(), @."\DataAccess\PGWException");
throw new ServiceException("PGW003","READ_STREAM_ERROR",e);
}
finally
{
if( sr != null)
sr.Close();
objResponse.Close();
}
Thank you,
Jap.
Have you seen this?
http://support.microsoft.com/defaul...kb;en-us;884537
- slightly different scenario, but you might be hitting the same bug.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 22 Apr 2005 10:10:02 GMT, "japslam japslam via
DotNetMonster.com" <forum@.nospam.DotNetMonster.com> wrote:
>Hi all,
>I have problem when I use HttpWebRequest and take long time to call to my
>service server. If at that time there are many request comes in
>semultaneous, I will get this exception
>System.Net.WebException: The underlying connection was closed: The request
>was canceled. --> System.IO.IOException: Unable to read data from the
>transport connection. --> System.ObjectDisposedException: Cannot access a
>disposed object named "System.Net.TlsStream".
>Object name: "System.Net.TlsStream".
> at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
> at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
> -- End of inner exception stack trace --
> at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
> at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
> -- End of inner exception stack trace --
> at System.Net.HttpWebRequest.CheckFinalStatus()
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
> at System.Net.HttpWebRequest.GetResponse()
> at MFEC.DealerServices.Service.PaymentGateway.CallPay mentGateway(String
>serviceName, GeneralParameterCollection inputParam)
>
>Does anybody know how to solve this problem ?
the default setting for webclient is to only allow two connections to a
remote server. if you calls are slow, and they stack up, you will have
timeout problems. also you could hit your max thread pool sizes.
try upping the number of connections.
(httpRequest.ServicePoint.ConnectionLimit)
-- bruce (sqlwork.com)
"japslam japslam via DotNetMonster.com" <forum@.DotNetMonster.com> wrote in
message news:1b2e8e50a4a5493bbb9004d9c3d2c1f0@.DotNetMonste r.com...
> Hi singh_angrez,
>
> Before I try your suggestion. I wanna show you about my code.
> And my server architecture is like this
> Web server --httprequest call to --> My service server
> Actually, If my service server reponse the result to me in a short time,
> everything is ok..no exception. But anytime my service server take long
> time to process and send me the result.. at that time if there are many
> requests from web server call to my service server, I got that exception
> until my service server have a good response.
> This is my code now. May be my code is not correct about HttpWebRequest
> property.
>
> //==== set ssl connection ==
> ServicePointManager.CertificatePolicy = new MyPolicy();
> HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create
> (PAYMENTGATEWAY_URL+strParam.ToString());
> objRequest.Method = "GET";
> //==== add new code ==
> objRequest.KeepAlive = false;
> objRequest.ProtocolVersion=HttpVersion.Version10;
> objRequest.Proxy = System.Net.WebProxy.GetDefaultProxy(); // I use
> default proxy which work well in normal time.
> objRequest.AllowAutoRedirect=true;
> objRequest.MaximumAutomaticRedirections=10;
> objRequest.Timeout = (int) new TimeSpan(0,0,HTTPTIMEOUT)
> .TotalMilliseconds; // ,HTTPTIMEOUT = 300
> objRequest.UserAgent="Mozilla/3.0 (compatible; My Browser/1.0)";
> //==== add new code ==
> string str = null;
> HttpWebResponse objResponse;
> StreamReader sr = null;
> try
> {
> objResponse = (HttpWebResponse)objRequest.GetResponse();
> }
> catch( Exception e)
> {
> EventMgmt.EventExceptionMsg("Payment Gateway-GetResponse() =>
> "+e.ToString(), @."\DataAccess\PGWException");
> throw new ServiceException("PGW001","HOST_UNREACHABLE",e);
> }
> try
> {
> sr = new StreamReader(objResponse.GetResponseStream());
> str = sr.ReadToEnd().Replace('\n'.ToString(),"").Replace('\t'.ToString()
> ,"").Replace('&'.ToString(),"");
> }
> catch( Exception e)
> {
> EventMgmt.EventExceptionMsg("Payment Gateway-ReadResponseStream() =>
> "+e.ToString(), @."\DataAccess\PGWException");
> throw new ServiceException("PGW003","READ_STREAM_ERROR",e);
> }
> finally
> {
> if( sr != null)
> sr.Close();
> objResponse.Close();
> }
>
> Thank you,
> Jap.
Please help ! Server Error in Application ! Object variable or
One urgent issue in ASP.Net.
We have hosted an asp.net application in a windows 2003 server machine. The
application runs well but ONCE IN A WHILE it comes up with the error, "Server
Error in '/CreditApplication' Application."
The error details are given below.
Sometimes, when we call the URL, it takes a long to load and finally doesnt
load and comes up with this error.
I dont understand why it works some time and doesnt work at other times.
The line in which the error is shown is a function, the contents of which
are given below.
*------------
Private Sub LocContracts()
Dim OnlineConnection As New OnlineConnection
Dim Sql, SqlComm, SqlDR
Dim Branch = "ABHN"
Dim DBConnection = OnlineConnection.OnlineDBConnection
(Database)
Dim Trans As SqlClient.SqlTransaction =
DBConnection.BeginTransaction(IsolationLevel.ReadC ommitted)
Sql = "Update Applications Set ContractType = 5,Repayment =
Case "
Sql = Sql & " when (LoanAmount * 3 / 100) > 40 Then
(LoanAmount * 3 /100)"
Sql = Sql & " else 40 End "
Sql = Sql & " where BranchId in ( Select BranchId from Branch
where BranchName = '" & Branch & "')"
Sql = Sql & " And ContractType = 0"
SqlComm = New SqlCommand(Sql, DBConnection)
SqlComm.Transaction = Trans
SqlDR = SqlComm.ExecuteReader()
Trans.Commit()
SqlDR.Close()
SqlComm = Nothing
Sql = Nothing
OnlineConnection = Nothing
End Sub
*------------
I was wondering if it has anything to do with "isolationlevel.readcommitted"
The error message is given below
*------------
Server Error in '/CreditApplication' Application.
________________________________________
Object variable or With block variable not set.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object variable or With
block variable not set.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object variable or With block variable not set.]
Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o, Type
objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
+934
Extraction.ViewApplication.LocContracts() in
D:\CreditApplication-1.0H\ViewApplication\ViewApplicationExtraction.asp x.vb:396
Extraction.ViewApplication.Page_Load(Object sender, EventArgs e) in
D:\CreditApplication-1.0H\ViewApplication\ViewApplicationExtraction.asp x.vb:54
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
________________________________________
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300
*------------
Any help would be really appreciated.
Many ThanksWhich line is 396 in your code? It's attempting to use a NULL object
somewhere. Possibly the database connection failed in
OnlineDBConnection. If this is production code, you should add some
exception handling and logging for the DB connection and execution
calls.
Also, why use a DataReader to execute an Update statement? An
ExecuteNonQuery() seems more appropriate in this case.
-Carl
Hi Carl,
Thanks very much for your reply.
I have updated my code with ExecuteNonquery().
Line 396 in my code is given below
Dim Trans As SqlClient.SqlTransaction =
DBConnection.BeginTransaction(IsolationLevel.ReadC ommitted)
As given in my post, iam getting this error only once in a while which is
really confusing me.
Regards,
Majo
"carl" wrote:
> Which line is 396 in your code? It's attempting to use a NULL object
> somewhere. Possibly the database connection failed in
> OnlineDBConnection. If this is production code, you should add some
> exception handling and logging for the DB connection and execution
> calls.
> Also, why use a DataReader to execute an Update statement? An
> ExecuteNonQuery() seems more appropriate in this case.
> -Carl
>
> We have hosted an asp.net application in a windows 2003 server machine. The
> application runs well but ONCE IN A WHILE it comes up with the error, "Server
> Error in '/CreditApplication' Application."
> The error details are given below.
Did you ever resolve this issue? I'm currently experiencing something
similar. An ASP.NET application was running fine on a Windows XP
machine. But now that we've moved it to Windows Server 2003, it
*sometimes* gets the error that you described:
System.NullReferenceException: Object variable or With block variable
not set.
at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack)
This is while accessing a COM object. Once again, it's worked
flawlessly on XP for quite a while now, but seems to occasionally have
problems on Windows Server 2003 (maybe the operating system isn't the
main issue, but I don't know what other differences exist).
- Roger
Hi Roger,
I havent solved my problem yet.
I was wondering if it has something to do with database locks. I checked for
any locks, but couldnt find any at the time of the error.
I have no idea how to solve this problem.
Please let me know if you come across any solutions.
Thanks
majo
"rogercnorris@.yahoo.com" wrote:
> > We have hosted an asp.net application in a windows 2003 server machine. The
> > application runs well but ONCE IN A WHILE it comes up with the error, "Server
> > Error in '/CreditApplication' Application."
> > The error details are given below.
> Did you ever resolve this issue? I'm currently experiencing something
> similar. An ASP.NET application was running fine on a Windows XP
> machine. But now that we've moved it to Windows Server 2003, it
> *sometimes* gets the error that you described:
> System.NullReferenceException: Object variable or With block variable
> not set.
> at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
> o, Type objType, String name, Object[] args, String[] paramnames,
> Boolean[] CopyBack)
> This is while accessing a COM object. Once again, it's worked
> flawlessly on XP for quite a while now, but seems to occasionally have
> problems on Windows Server 2003 (maybe the operating system isn't the
> main issue, but I don't know what other differences exist).
> - Roger
>
Hi,
This time, I got a new Server Error
"Fill: selectcommand.connection property has not been initialized" in
another asp page. This also comes only ONCE IN A WHILE.
The error is coming in the line with "Fill" in the code given below
*------------
DBConnection = OnlineConn.OnlineDBConnection(Database)
Sql = KeyWord
Dim SqlCommand As New SqlCommand(Sql, DBConnection)
Dim SqlAdapter As New SqlDataAdapter(SqlCommand)
Dim DataSet As New DataSet
SqlAdapter.Fill(DataSet)
*------------
While linking this with my previous error " Object variable with block ... "
, I was wondering if this error has anything to do with the database
connection.
Will this happen if the asp.net page is refreshed frequently ?
Thanks in advance for your help
Rgds,
Majo
"majo" wrote:
> Hi Roger,
> I havent solved my problem yet.
> I was wondering if it has something to do with database locks. I checked for
> any locks, but couldnt find any at the time of the error.
> I have no idea how to solve this problem.
> Please let me know if you come across any solutions.
> Thanks
> majo
>
> "rogercnorris@.yahoo.com" wrote:
> > > We have hosted an asp.net application in a windows 2003 server machine. The
> > > application runs well but ONCE IN A WHILE it comes up with the error, "Server
> > > Error in '/CreditApplication' Application."
> > > The error details are given below.
> > Did you ever resolve this issue? I'm currently experiencing something
> > similar. An ASP.NET application was running fine on a Windows XP
> > machine. But now that we've moved it to Windows Server 2003, it
> > *sometimes* gets the error that you described:
> > System.NullReferenceException: Object variable or With block variable
> > not set.
> > at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
> > o, Type objType, String name, Object[] args, String[] paramnames,
> > Boolean[] CopyBack)
> > This is while accessing a COM object. Once again, it's worked
> > flawlessly on XP for quite a while now, but seems to occasionally have
> > problems on Windows Server 2003 (maybe the operating system isn't the
> > main issue, but I don't know what other differences exist).
> > - Roger
Hi,
I created a new virtual directory in IIS and xcopied the whole content
(which is giving me the server error)
Right at the moment when i got the server error in my initial application, i
tried the new application which was created by me and it WORKED WELL.
Does this mean, that this server error has nothing to do with database locks
or IIS ?
I think, it has something to do with concurrent connections.
Can anyone help me with the connection parameters which i should use.
Many thanks...
Please help ! Server Error in Application ! Object variable or
One urgent issue in ASP.Net.
We have hosted an asp.net application in a windows 2003 server machine. The
application runs well but ONCE IN A WHILE it comes up with the error, "Serve
r
Error in '/CreditApplication' Application."
The error details are given below.
Sometimes, when we call the URL, it takes a long to load and finally doesnt
load and comes up with this error.
I dont understand why it works some time and doesnt work at other times.
The line in which the error is shown is a function, the contents of which
are given below.
*---
Private Sub LocContracts()
Dim OnlineConnection As New OnlineConnection
Dim Sql, SqlComm, SqlDR
Dim Branch = "ABHN"
Dim DBConnection = OnlineConnection.OnlineDBConnection
(Database)
Dim Trans As SqlClient.SqlTransaction =
DBConnection.BeginTransaction(IsolationLevel.ReadCommitted)
Sql = "Update Applications Set ContractType = 5,Repayment =
Case "
Sql = Sql & " when (LoanAmount * 3 / 100) > 40 Then
(LoanAmount * 3 /100)"
Sql = Sql & " else 40 End "
Sql = Sql & " where BranchId in ( Select BranchId from Branch
where BranchName = '" & Branch & "')"
Sql = Sql & " And ContractType = 0"
SqlComm = New SqlCommand(Sql, DBConnection)
SqlComm.Transaction = Trans
SqlDR = SqlComm.ExecuteReader()
Trans.Commit()
SqlDR.Close()
SqlComm = Nothing
Sql = Nothing
OnlineConnection = Nothing
End Sub
*---
I was wondering if it has anything to do with "isolationlevel.readcommitted"
The error message is given below
*---
Server Error in '/CreditApplication' Application.
________________________________________
Object variable or With block variable not set.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information abou
t
the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object variable or With
block variable not set.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object variable or With block variable not set.]
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type
objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack
)
+934
Extraction.ViewApplication.LocContracts() in
D:\CreditApplication-1. 0H\ViewApplication\ViewApplicationExtrac
tion.aspx.vb:
396
Extraction.ViewApplication.Page_Load(Object sender, EventArgs e) in
D:\CreditApplication-1. 0H\ViewApplication\ViewApplicationExtrac
tion.aspx.vb:
54
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
________________________________________
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300
*---
Any help would be really appreciated.
Many ThanksWhich line is 396 in your code? It's attempting to use a NULL object
somewhere. Possibly the database connection failed in
OnlineDBConnection. If this is production code, you should add some
exception handling and logging for the DB connection and execution
calls.
Also, why use a DataReader to execute an Update statement? An
ExecuteNonQuery() seems more appropriate in this case.
-Carl
> We have hosted an asp.net application in a windows 2003 server machine. The
> application runs well but ONCE IN A WHILE it comes up with the error, "Ser
ver
> Error in '/CreditApplication' Application."
> The error details are given below.
Did you ever resolve this issue? I'm currently experiencing something
similar. An ASP.NET application was running fine on a Windows XP
machine. But now that we've moved it to Windows Server 2003, it
*sometimes* gets the error that you described:
System.NullReferenceException: Object variable or With block variable
not set.
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack)
This is while accessing a COM object. Once again, it's worked
flawlessly on XP for quite a while now, but seems to occasionally have
problems on Windows Server 2003 (maybe the operating system isn't the
main issue, but I don't know what other differences exist).
- Roger
Please help ! Server Error in Application ! Object variabl
I havent solved my problem yet.
I was wondering if it has something to do with database locks. I checked for
any locks, but couldnt find any at the time of the error.
I have no idea how to solve this problem.
Please let me know if you come across any solutions.
Thanks
majo
"rogercnorris@dotnet.itags.org.yahoo.com" wrote:
> Did you ever resolve this issue? I'm currently experiencing something
> similar. An ASP.NET application was running fine on a Windows XP
> machine. But now that we've moved it to Windows Server 2003, it
> *sometimes* gets the error that you described:
> System.NullReferenceException: Object variable or With block variable
> not set.
> at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object
> o, Type objType, String name, Object[] args, String[] paramnames,
> Boolean[] CopyBack)
> This is while accessing a COM object. Once again, it's worked
> flawlessly on XP for quite a while now, but seems to occasionally have
> problems on Windows Server 2003 (maybe the operating system isn't the
> main issue, but I don't know what other differences exist).
> - Roger
>Hi,
This time, I got a new Server Error
"Fill: selectcommand.connection property has not been initialized" in
another asp page. This also comes only ONCE IN A WHILE.
The error is coming in the line with "Fill" in the code given below
*--
DBConnection = OnlineConn.OnlineDBConnection(Database)
Sql = KeyWord
Dim SqlCommand As New SqlCommand(Sql, DBConnection)
Dim SqlAdapter As New SqlDataAdapter(SqlCommand)
Dim DataSet As New DataSet
SqlAdapter.Fill(DataSet)
*--
While linking this with my previous error " Object variable with block ... "
, I was wondering if this error has anything to do with the database
connection.
Will this happen if the asp.net page is refreshed frequently ?
Thanks in advance for your help
Rgds,
Majo
"majo" wrote:
> Hi Roger,
> I havent solved my problem yet.
> I was wondering if it has something to do with database locks. I checked f
or
> any locks, but couldnt find any at the time of the error.
> I have no idea how to solve this problem.
> Please let me know if you come across any solutions.
> Thanks
> majo
>
> "rogercnorris@.yahoo.com" wrote:
>
Hi,
I created a new virtual directory in IIS and xcopied the whole content
(which is giving me the server error)
Right at the moment when i got the server error in my initial application, i
tried the new application which was created by me and it WORKED WELL.
Does this mean, that this server error has nothing to do with database locks
or IIS ?
I think, it has something to do with concurrent connections.
Can anyone help me with the connection parameters which i should use.
Many thanks...
Please help ?
We have complete ASP.net application in our local web server which was created on vb.net.
Now we want to make this application work in different server , basically hand over this application to another company ?
I am planning to ZIP the folder where my application contains, which includes BIN folder also. And also WEB.CONFIG file.
So, my question is , what are the things i should ask them, whether they have all these ??
As of i know, they should have W2K / XP, IIS , .NET framework .
Please advice me !
Thanks,
NicolRather than thinking along the lines of a "hand over", you might be better considering this a "deployment" of your ASP.NET application.
With that in mind,this MSDN article walks through the deployment of an ASP.NET app to a new server.
This MSDN article talks about deploying and distributing an application.
From a business point of view, you might want to refrain from saying to either your client or the other development company, "This is what you need." If you are wrong (and there are LOTS of things to consider), then they might come back to you and argue, "Yousaid that this is all we need, but it's not!"
You might be better served listing how you developed your application (eg, framework version, language, IIS version and configuration, development environment, database, commercial or free components you used ... that sort of thing). You can tell them, quite honestly, that there is no single "right configuration or environment" they need. Just illustrate what setup *you* used and state, quite reasonably, that you cannot guarantee it will work automatically on any other setup.
As to what you put on the CD, give them everything except any components you purchased. Give them one folder called "WORKING" with all your .vb components before compilation and unflattened photoshop files and so on, and another folder called "AS DEPLOYED" that you simply copy from your Inetpub/wwwroot folder (or wherever the real directory is).
One thing to consider, and I wouldn't presume to advise you on this ... but what about the rights to use the code? If you developed, say, an email component, are you able to use the same code for your next application? Can you use code for "common components" that are not "application-specific"?
Some things to think about, anyway ...
Please Help how do I Microsoft.XMLHTTP in .net
set xml1 = CreateObject("Microsoft.XMLHTTP")
xml1.Open "GET", strURL, False
xml1.send
strXmlContents = xml1.responseText
how do I do this in .aspx?with the HTTPWebRequest class. here :
http://rtfm.atrax.co.uk/infinitemonkeys/articles/asp.net/990h.asp
That looks really nice for an advanced programer but I am completly lost. Is that in c#?
<%@. import namespace="System.Net" %>
WebClient objClient = new WebClient();
private void Page_Load(Object o, EventArgs e){
WebClient objClient = new WebClient();
}
private void Page_Load(Object o, EventArgs e){
WebClient objClient = new WebClient();
Stream objStream = objClient.OpenRead("http://lycosa/default.asp");
}
Is this all I need? what do I save this as?
> Is this all I need?
not quite. this is the code you need, sure, but you need to fill in a few bits round it. I take it you're a raw novice then?
I think I got thst part
<%@. import namespace="System.IO" %>
<%@. Control Language="vb" debug="true" Codebehind="Live Lines.ascx.vb" %>
<HTML>
<HEAD>
<title>Messing around with ASP.NET in VB</title>
</HEAD>
<body>
<script language="VB" runat="server"
Public Sub Page_Load()
Dim fileName as String
fileName = "C:\schedule.txt"
Dim strmR as StreamReader = File.OpenText(fileName)
lblStart.Text = Server.HtmlEncode(strmR.ReadToEnd()).Replace(vbcrlf, "<br />")
strmR.Close()
End Sub
</script>
<asp:label runat="server" id="lblStart" font-name="verdana" />
</body>
</HTML
This seems to work for me. 2 questions
1. How can I change this fileName = "C:\schedule.txt" for non local files? Like this, fileName = "http://blah/schedule.txt" ?
2. My information is now displayed like this
1| 1|20030915|18:05|DALLAS |219| 37|
1| 1|20030915|18:05|NY GIANTS |220| 7|
How do I convert this to xml and display it if I know the name for each category?
Yes I am a super nooob
Anyone have a suggestion?
You're going to need to split the delimited file first at the linebreaks, then at the pipe characters (|), then you'll be able to loop through the resulting arrays and stick them in an XML document.
I'll scout around and see if there's a tutorial on it somewhere, but equally there may be a library for this task on this very site...
Wednesday, March 21, 2012
please help Im a designer not a network guy
A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.
When I click on details it further explains:
soap:Server Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown. A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered as safe on this site. You may not be able to open this page in an HTML editor that is compatible with Microsoft Windows SharePoint Services, such as Microsoft Office FrontPage. To fix this page, contact the site administrator to have the Web Part or Web Form Control configured as safe. You can also remove the Web Part or Web Form Control from the page by using the Web Parts Maintenance Page. If you have the necessary permissions, you can use this page to disable Web Parts temporarily or remove personal settings. For more information, contact your site administrator.
I contacted my site administrator and she doesn't want to help me so I figure if I can tell her exactly how to fix the problem she might be more inclined to hear me out. I might need it explained as simply as possible because I'm not a networking genius and I don't think our systems administrator is either.You may want to hit up a Sharepoint site for more help... but it sounds like the new webpart you have (I'm assuming you wrote it?) isn't added into Sharepoint... not sure how to do it personally but I would think a post to a Sharepoint site/newsgroup/forum may get you better/more results.
please help me
Server Error in '/VEPWEB' Application.
----
--
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: Could not load file or assembly
'IBA.Common.Controls.WebControls.ScrollableGrid, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=cabd7206fce9d8db' or one of its
dependencies. The system cannot find the file specified.
Source Error:
Line 86: <add assembly="System.Drawing.Design, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 87: <add assembly="System.EnterpriseServices, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 88: <add
assembly="IBA.Common.Controls.WebControls.ScrollableGrid,
Version=1.1.0.0, Culture=neutral, PublicKeyToken=CABD7206FCE9D8DB"/>
Line 89: </assemblies>
Line 90: <buildProviders>
Source File: C:\CheckOut\VEPWeb\web.config Line: 88Check your References folder for missing a assembly, it should have a
warning icon.
It should be 'IBA.Common.Controls.WebControls.ScrollableGrid'.
Delete the reference then re-add it. If that still doesn't work re-compile
'IBA.Common.Controls.WebControls' solution and update the reference.
Regards,
Brian K. Williams
"ggroup" <nimshathameen@.gmail.com> wrote in message
news:1169100986.262250.114500@.38g2000cwa.googlegroups.com...
> following error occur while i run my site.
> Server Error in '/VEPWEB' Application.
> ----
--
> 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: Could not load file or assembly
> 'IBA.Common.Controls.WebControls.ScrollableGrid, Version=1.1.0.0,
> Culture=neutral, PublicKeyToken=cabd7206fce9d8db' or one of its
> dependencies. The system cannot find the file specified.
> Source Error:
>
> Line 86: <add assembly="System.Drawing.Design, Version=2.0.0.0,
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
> Line 87: <add assembly="System.EnterpriseServices, Version=2.0.0.0,
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
> Line 88: <add
> assembly="IBA.Common.Controls.WebControls.ScrollableGrid,
> Version=1.1.0.0, Culture=neutral, PublicKeyToken=CABD7206FCE9D8DB"/>
> Line 89: </assemblies>
> Line 90: <buildProviders>
>
> Source File: C:\CheckOut\VEPWeb\web.config Line: 88
>
please help me
Server Error in '/VEPWEB' Application.
------------------------
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: Could not load file or assembly
'IBA.Common.Controls.WebControls.ScrollableGrid, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=cabd7206fce9d8db' or one of its
dependencies. The system cannot find the file specified.
Source Error:
Line 86: <add assembly="System.Drawing.Design, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 87: <add assembly="System.EnterpriseServices, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 88: <add
assembly="IBA.Common.Controls.WebControls.ScrollableGrid,
Version=1.1.0.0, Culture=neutral, PublicKeyToken=CABD7206FCE9D8DB"/>
Line 89: </assemblies>
Line 90: <buildProviders>
Source File: C:\CheckOut\VEPWeb\web.config Line: 88Check your References folder for missing a assembly, it should have a
warning icon.
It should be 'IBA.Common.Controls.WebControls.ScrollableGrid'.
Delete the reference then re-add it. If that still doesn't work re-compile
'IBA.Common.Controls.WebControls' solution and update the reference.
Regards,
Brian K. Williams
"ggroup" <nimshathameen@.gmail.comwrote in message
news:1169100986.262250.114500@.38g2000cwa.googlegro ups.com...
Quote:
Originally Posted by
following error occur while i run my site.
>
Server Error in '/VEPWEB' Application.
------------------------
>
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: Could not load file or assembly
'IBA.Common.Controls.WebControls.ScrollableGrid, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=cabd7206fce9d8db' or one of its
dependencies. The system cannot find the file specified.
>
Source Error:
>
>
Line 86: <add assembly="System.Drawing.Design, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 87: <add assembly="System.EnterpriseServices, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 88: <add
assembly="IBA.Common.Controls.WebControls.ScrollableGrid,
Version=1.1.0.0, Culture=neutral, PublicKeyToken=CABD7206FCE9D8DB"/>
Line 89: </assemblies>
Line 90: <buildProviders>
>
>
Source File: C:\CheckOut\VEPWeb\web.config Line: 88
>
Please help me and solve my Problem
hi, i'm ASP developer, now a days i'm facing this problem
after uploading my site on hosting server. please any on
help me and solve my Problem.
Problem is as follow...
Active Server Pageserror 'ASP 0113'
Script timed out
/show_link_detail.asp
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.
waiting for your Kind Reply
Thanks
SYSOL
This could be caused by a number of things. Perhaps the connection to your database is defined incorrectly, or you have a long-running query that works in your environment but not in the more restrictive environment of your ISP/Production Server.
Does this form ordinarily take a while to load?
Please help me improve this class for accessing database data
I've just written my first class that attempts to perform the following actions:
1. Connect to SQL Server 2000 using the connection defined in web.config
2. Execute a stored procedure (passed as a parameter) using any number of SQL parameters
3. Return the data as a dataTable back to the calling page
I need some really general advice from you experts to help improve it in the following ways if possible:
1. Reliability
2. Performance
Although it does work, it's probably quite badly written as to be honest I don't really know what I'm doing. Any help would be really appreciated!
Namespace myNS
Public Class dataGrabber
Private Shared myConn As New SqlConnection(ConfigurationManager.ConnectionStrings("myConnString").ConnectionString)
Private Shared mySQLCommand As New SqlCommand
Private Shared myDataReader As SqlDataReader
Public Sub New(ByVal storedProcedureToRun As String)
mySQLCommand.Connection = myConn
mySQLCommand.CommandText = storedProcedureToRun
mySQLCommand.CommandType = CommandType.StoredProcedure
End Sub
Public Sub AddParam(ByVal paramName As String, ByVal paramDataType As SqlDbType, ByVal paramValue As String)
Dim tmpParam As New SqlParameter(paramName, paramDataType)
tmpParam.Value = paramValue
mySQLCommand.Parameters.Add(tmpParam)
End Sub
Public ReadOnly Property getData() As DataTable
Get
Dim myDataTable As New DataTable
mySQLCommand.Connection.Open()
myDataReader = mySQLCommand.ExecuteReader(CommandBehavior.CloseConnection)
myDataTable.Load(myDataReader)
mySQLCommand.Parameters.Clear()
mySQLCommand.Dispose()
Return myDataTable
End Get
End Property
End Class
End Namespace
With my expereince, I always make my data layers static, there is really no need to maintain class instances in the data layer, however there are exceptions depending on the requirements of your project.
In my data layers, I execute a command like so: MyDataLayer.ExecuteDataSet(cn, "SP_NAME", object[] args);
notice the last parameter is an object array that will hold the parameters for the stored proc.
If you want some good ideas and good practices, download microsofts data access application block and look through the code. They have some good code in there that uses caching for parameters and connections, which speeds up the datalayer.
Also take a look at patterns & practices on msdn. there is alot of good info on there.
You shouldn't make your class-level variables (myConn etc) shared. And if you want to return a DataTable you could use the DataAdapter rather than getting a Reader and loading it into a DataTable.
Thanks both for your help.
>> You shouldn't make your class-level variables (myConn etc) shared
I thought Shared just meant that other subs and functions in the class could access these once they had been declared. Obviously not. What is Shared therefore?
>> if you want to return a DataTable you could use the DataAdapter rather than getting a Reader and loading it into a DataTable
Could you please provide an example of this that would fit the code above?
Thanks again guys!
Shared means there is only one instance of the object that spans all classes. So if you create two instances of your data class they both share the same connection and command object. So if one user on your site is running SPA and at the same time another user is running SPB you will get unexpected results.
For the DataAdapter;
http://authors.aspalliance.com/aspxtreme/sys/data/Common/DataAdapterClassFill.aspx
Hi Aidy
From the examples I can see online, all use a dataAdapter to fill adataTable or dataSet. Therefore (from my basic understanding
I'm using the class in my pages as follows;
Dim DBAccess As New myNS.dataGrabber("sp_getlogin") ' instance of class
DBAccess.AddParam("username", SqlDbType.NVarChar, loginControl.UserName) ' add param username
DBAccess.AddParam("password", SqlDbType.NVarChar, loginControl.Password) ' add param password
Dim loginTable As DataTable = DBAccess.getData() ' returns values from database to use for this user
please help me soon!
<authentication mode="none" /><!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny acces
to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
(unauthenticated) users
--><forms name=".ASPXAUTH
loginUrl="orderdetails.aspx
protection="Validation
timeout="999999" /><authorization
this is a page I want to run . if i new virtual directory in server all the pages are in asp and run and just i have 2 page in .net that want to run in this project does it need have two virtual directory one for asp.net pages and another for asp pages and does it couse problem
If some body can help meFirst what sort of error do you get and second, no you do not need to virtual web servers.
hi this is an error
this is an error to use a section register as allow definition='machine to application' beyond application level.yhis error can be coused by a virtual directory not being configured as an application in iis