|
Provide the width measurement only in percent like 50% or 100%. Pixel measurements will always have display issues.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi
I've got this message and I don't know how to solve the problem.
Error message first, Source code and then the example of SQL connection.
Error message:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
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.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
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:
[InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.]
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +1184409
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +196
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, String spName, Object[] parameterValues) +222
FG2007.objUser.LoginUser(String UserName, String Password) +108
FG2007.Login.Btn_Login_Click(Object sender, ImageClickEventArgs e) +510
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Source code:
public partial class Login : System.Web.UI.Page
{
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.btn_Login.Click += new System.Web.UI.ImageClickEventHandler(this.Btn_Login_Click);
this.btn_PukReg.Click += new System.Web.UI.ImageClickEventHandler(this.Btn_PukReg_Click);
}
#endregion
protected void Page_Load(object sender, System.EventArgs e)
{
UserName.Attributes.Add("onkeypress", "return handleEnter('" + btn_Login.ClientID + "', event)");
txtPuk.Attributes.Add("onkeypress", "return handleEnter('" + btn_PukReg.ClientID + "', event)");
if (!IsPostBack)
{
if (Request.Cookies["USERNAME"] != null)
UserName.Text = Request.Cookies["USERNAME"].Value;
if (Request.Cookies["PASSWORD"] != null)
Password.Attributes.Add("value", Request.Cookies["PASSWORD"].Value);
if (Request.Cookies["USERNAME"] != null && Request.Cookies["PASSWORD"] != null)
RememberMe.Checked = true;
}
emailp = Request.QueryString["emailp"];
if (emailp != null)
{
txtPuk.Text = emailp;
}
if (!IsPostBack)
{
string mode = Request.QueryString["mode"];
switch (mode)
{
case "pukbad":
lblPukMsg.Text = BADPUK;
lblPukMsg.ForeColor = Color.Red;
Helpers.SetFocus(this, txtPuk);
break;
case "pukformsaved":
lblPukMsg.Text = PUKFORMSAVED;
lblPukMsg.ForeColor = Color.Green;
Helpers.SetFocus(this, txtPuk);
break;
default:
lblPukMsg.Text = string.Empty;
Helpers.SetFocus(this, txtPuk);
break;
}
}
else
if (UserName.Text.Length > 0)
{
Helpers.SetFocus(this, UserName);
}
else
Helpers.SetFocus(this, txtPuk);
if (emailp != null)
{
lblPukMsg.Text = string.Empty;
lblPukMsg.ForeColor = Color.Red;
txtPuk.Text = txtPuk.Text.Trim().ToUpper();
switch (txtPuk.Text.Length)
{
case 10:
switch (objContract.CheckPuk(txtPuk.Text))
{
case 0:
case 1:
break;
case -1:
lblPukMsg.Text = BADPUK;
break;
case 2:
lblPukMsg.Text = PUKUSED;
break;
}
break;
case 12:
Guid ContractID = Guid.Empty;
Guid GroupID = Guid.Empty;
Guid FormID = Guid.Empty;
if (objGroup.CheckPuk(txtPuk.Text, out ContractID, out GroupID, out FormID) >= 0)
{
Helpers.SetCurrentContract(ContractID);
Helpers.SetCurrentGroup(GroupID);
Helpers.CheckCurrentGroup();
if (FormID != Guid.Empty)
{
lblPukMsg.Text = PUKUSED;
}
else
{
if (objContract.Current.AspektMode <= 0 && objContract.Current.ShowReports)
{
lblPukMsg.Text = CONTRACT_FINALIZED;
}
else
{
}
}
}
else
lblPukMsg.Text = BADPUK;
break;
default:
lblPukMsg.Text = BADPUK;
break;
}
}
}
private void Btn_Login_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
if (RememberMe.Checked == true)
{
Response.Cookies["USERNAME"].Value = UserName.Text;
Response.Cookies["USERNAME"].Expires = DateTime.Now.AddYears(30);
Response.Cookies["PASSWORD"].Value = Password.Text;
Response.Cookies["PASSWORD"].Expires = DateTime.Now.AddYears(30);
}
else
{
Response.Cookies["USERNAME"].Expires = DateTime.Now.AddYears(-30);
Response.Cookies["PASSWORD"].Expires = DateTime.Now.AddYears(-30);
}
objUser user = objUser.LoginUser(this.UserName.Text, this.Password.Text);
if (user != null)
{
Session["CurrentUser"] = user;
if (user.uType != objUser.UserType.Free)
{
Helpers.CheckCurrentContract();
Helpers.CheckCurrentGroup();
}
switch (user.uType)
{
case objUser.UserType.Super:
case objUser.UserType.Admin:
case objUser.UserType.Ledare:
Response.Redirect("Contracts.aspx", true);
break;
case objUser.UserType.Medlem:
Response.Redirect("Puks.aspx", true);
break;
case objUser.UserType.Free:
Response.Redirect("Support.aspx", true);
break;
case objUser.UserType.Viewer:
Response.Redirect("Reports.aspx", true);
break;
}
}
else
{
this.Lbl_Msg.ForeColor = Color.Red;
this.Lbl_Msg.Text = "<br>Fel användarnamn <br>eller lösenord.<br><br>";
}
}
Using these kind of SQL-connections:
public static DataSet ListUsers()
{
return SqlHelper.ExecuteDataset(ObjDBAbstract.GetConnectionString(), "users_list", Guid.Empty);
}
|
|
|
|
|
First of all use the CODE tag whenever you are posting code. your current code is unreadable.
ok so You are not closing the existing connection. close the connection as soon as you finished communicating.
i.e. after using the reader/datatable/dataset, insert/delete/update query.
if you are closing the connection and then also you are getting the error, due to very busy website. change the MAX POOL SIZE in the connection string.
connectionString="Server=XXX;Database=XXX;User Id=XXX;password=XXX;connection timeout=0;Max Pool Size = 100;Pooling = True"
|
|
|
|
|
Thanks for your reply
I have corrected CODE tag
I know that I am not closing the existing connection, but I do not know which, that's the problem
Thanks Anders
|
|
|
|
|
In your code
return SqlHelper.ExecuteDataset(ObjDBAbstract.GetConnectionString(), "users_list", Guid.Empty);
in the ExecuteDataset try makng use of the USING statement, this will automaically close and dispose of your connection
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I have a GridView which is teamed up with a DetailsView and they work fine. I've added New , Delete and Edit buttons to the DetailsView and that all works fine too.
The problem I have is what to do if there are no rows in the GridView . The DetailsView shows nothing, not even the buttons so I can't simply add a new item from there.
I can create a new button which will open a new page to create a new item but this seems very clumsy and inelegant.
Can someone suggest a better way of doing this? Is it possible to force the display of the DetailsView rows including the buttons, even if the GridView is empty?
Thanks
|
|
|
|
|
can update panels triger an event in paralle if yes how? please help
|
|
|
|
|
Hi - I'm new to vb.net and stuck with a little problem....I can write the string out as raw data but want to write it out so that it makes sense as "english" (formatted list I suppose). Can anybody help please? Here is my working code:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strDataToPost As String
Dim myWebRequest As WebRequest
Dim myRequestStream As Stream
Dim myStreamWriter As StreamWriter
Dim myWebResponse As WebResponse
Dim myResponseStream As Stream
Dim myStreamReader As StreamReader
' Create a new WebRequest which targets that page with
' which we want to interact.
myWebRequest = WebRequest.Create( _
"http://test..co.uk/XmlService.asmx")
' Set the method to "POST" and the content type so the
' server knows to expect form data in the body of the
' request.
With myWebRequest
.Method = "POST"
.ContentType = "text/xml"
End With
' Here's the data I'll be sending. It's the same format
' you'd use in a querysting and you should URLEncode any
' data that may need it.
strDataToPost = "<RegionSearch>blah</RegionSearch>"
' Get a handle on the Stream of data we're sending to
' the remote server, connect a StreamWriter to it, and
' write our data to the Stream using the StreamWriter.
myRequestStream = myWebRequest.GetRequestStream()
myStreamWriter = New StreamWriter(myRequestStream)
myStreamWriter.Write(strDataToPost)
myStreamWriter.Flush()
myStreamWriter.Close()
myRequestStream.Close()
' Get the response from the remote server.
myWebResponse = myWebRequest.GetResponse()
' Get the server's response status?
' Just like when we sent the data, we'll get a reference
' to the response Stream, connect a StreamReader to the
' Stream and use the reader to actually read the reply.
myResponseStream = myWebResponse.GetResponseStream()
myStreamReader = New StreamReader(myResponseStream)
litResponseText.Text = myStreamReader.ReadToEnd()
myStreamReader.Close()
myResponseStream.Close()
' Close the WebResponse
myWebResponse.Close()
End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ASP.NET HTTP Post Request Sample</title>
</head>
<body>
<form id="myForm" runat="server">
<p>
<strong>This page made an HTTP post request to:</strong><br />
<code> http://test..co.uk/XmlService.asmx
</code>
</p>
<p>
<strong>It sent regions request data:</strong><br />
</code>
</p>
<p>
<strong>The Response:</strong>
</p>
<table border="1">
<tr><td>
<asp:Literal ID="litResponseText" runat="server" />
</td></tr>
</table>
<hr />
</form>
</body>
</html>
Kind regards
Andy
|
|
|
|
|
I'm using this code to run process:
"...
_apppath = String.Concat(_apppath, "zvprtcfg_win32");
string _command = " Zan Image Printer(fax) print.html = ";
_command += strHtmlFileName;
try
{
Process _proc = new Process();
_proc.StartInfo.Arguments = _command;
_proc.StartInfo.FileName = _apppath;
if (_proc.Start())
{
int _i = 0;
do
{
_proc.WaitForExit(1000);
if (_proc.HasExited)
{
_bOk = true;
break;
}
} while (_proc.Responding && _i++ < 30);
if (!_bOk)
{
_proc.Kill();
}
}
}
catch (Exception eproc){}
..."
This works fine with my XP machine with IIS V5.1, but I can't make this work with Server 2003 and IIS V6.0.
In Server 2003, the process shows in the task manager, but it doesn't execute as I'm expecting.
ASPNET user run "zvprtcfg_win32" process on my machine and NETWORK SERVICE user run it on Server 2003.
Please give me some advice, solution...
Thanks in advance.
"...And then she'd say, it's Ok, I got lost on the way
but I'm a supergirl, and supergirls don't cry. ..." Reamonn
|
|
|
|
|
Hi,
I think the problem is the account "Network Service". This one will not have the rights to run your process as you expecting it. Try to figure out what rights for this user are missing (file, printer access etc.).
The network service is the default user for ASP.NET under Win2003 and IIS 6.0. Maybe you can figure out how to change the default use, so that ASP.NET is executed with other permissions.
Hope this helps you a bit.
Regards
Sebastian
P.S. Have a look at the event log of Windows, there you will find some information about critical operations etc, which where denied.
|
|
|
|
|
Thank you very much.
Everything you wrote I already know, but I totally forgot "P.S." part . And there (at the Event log) was solution to my problem.
Thanks once more.
Regards,
Nina
My problem was:
The machine-default permission settings do not grant Local Activation permission for Internet Explorer to the user NT AUTHORITY\NETWORK SERVICE.
"...And then she'd say, it's Ok, I got lost on the way
but I'm a supergirl, and supergirls don't cry. ..." Reamonn
|
|
|
|
|
I captured the value of Id of the browser using Request.Querystring but the problem is the value caputered had "+" symbol which is not being shown. Its taking as a concatination.
How can i handle.
|
|
|
|
|
The querystring will convert + sign to white space character. You have to write code for track this.
|
|
|
|
|
You need to make sure the querystring is URL Encoded. I use the following function that i find useful
Public Function Encrypt_UrlEncode(ByVal textToEncrypt As String) As String
Try
Return System.Web.HttpUtility.UrlEncode(textToEncrypt, System.Text.Encoding.Default)
Catch ex As Exception
Throw ex
End Try
end function
In your code before you redirect do something like this
Dim queryString as string=Encrypt_UrlEncode(WhatEverStringYouWantToPassAsQueryString)
response.redirect("http://www.abc.com/RedirectPage.aspx?Q=" & queryString)
Good Luck
RH
|
|
|
|
|
Hello,
I have a asp:listView control bound to a LinqDatasource, works fine.
In code behind (as a result of a buttonclick somewhere) i would like to get a dataitem from the datasource (or maybe the ListView) based on the Listviews SelectedIndex.
Tried to get it from listview.Items[listview.SelectedIndex], but the DataItem member is always null.
Any ideas?
Thanks in advance,
Antoon
|
|
|
|
|
Hi
Friends i am using auto complete extender (ajax) in my web page ,
Its something like showing city names
My problem is when the user types it doesnt displays the option when user halts for a second it displays the option
I want to know , this can be done simultaneously , as soon as the button is clicked options has to be shown
Please if anyone knows how it is done then do let me know
thanks and regards
( please go to apple.com and type iphone, You will notice the speed )
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Pls Help me in the following issues..
I have programattically created link buttons inside the datagrid header and items as described below:-
*******
Sub DGDoc_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DGDoc.ItemCreated
Try
If e.Item.ItemType = ListItemType.Header Then
Dim DelLink As New LinkButton()
DelLink.Text = "Delete"
DelLink.Attributes.Add("runat", "server")
DelLink.Attributes.Add("id", "OnDelete")
DelLink.Attributes.Add("CommandName", "OnDelete")
DelLink.Attributes.Add("CommandArgument", "OnDelete")
'AddHandler DelLink.Command, AddressOf Dg_ItemDatabound
e.Item.Cells(8).Controls.Add(DelLink)
Dim EditLink As New LinkButton()
EditLink.Text = "Disp.Order/Edit"
EditLink.Attributes.Add("runat", "server")
EditLink.Attributes.Add("id", "OnEdit")
EditLink.Attributes.Add("CommandName", "OnEdit")
EditLink.Attributes.Add("CommandArgument", "OnEdit")
e.Item.Cells(7).Controls.Add(EditLink)
ElseIf e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim DownLink As New LinkButton()
DownLink.Text = "Download"
DownLink.Attributes.Add("runat", "server")
DownLink.Attributes.Add("id", "OnDownload")
DownLink.Attributes.Add("CommandName", "OnDownload")
DownLink.Attributes.Add("CommandArgument", "OnDownload")
e.Item.Cells(5).Controls.Add(DownLink)
End If
Catch ex As Exception
Response.Write("Error :" & ex.Message)
End Try
End Sub
********
And clicking on to the link buttons created following code is to be executed
***
Sub Dg_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DGDoc.ItemCommand
Try
Select Case e.CommandName
Case "OnDownload"
---
Case "OnEdit"
---
Case "OnDelete"
---
End Select
Catch ex As Exception
Response.Write("Error :" & ex.Message)
End Try
End Sub
***
But my problem is i'm not getting the value of "e.CommandName"
Pls help me in resolving these issues
|
|
|
|
|
I think the CommandName property is cleaning at the time of postback. Check your code.
|
|
|
|
|
But Pls tell me how? pls suggest me someway to do things i want.
|
|
|
|
|
Hello!
I'm searching the flash video component for my simple video system.
I can't find any free component for publishing videos on my project.
Anyone can suggest me a component for showing videos.
and other queiston is;
How i can control uploaded contents to my server for to the harmfully files.
Last user can upload infected files to my server how i can prevent this.
Thanks.
Sorry for my bad english.
Greetings From Turkey.
|
|
|
|
|
Sosyopat wrote: I'm searching the flash video component for my simple video system.
I can't find any free component for publishing videos on my project.
Anyone can suggest me a component for showing videos.
Are you looking for an FLV player[^]?
Sosyopat wrote:
How i can control uploaded contents to my server for to the harmfully files.
Last user can upload infected files to my server how i can prevent this.
Try to call an anti virus routine which installed on server or something like that.
|
|
|
|
|
thanks for the reply.i found it at the last.
|
|
|
|
|
i have publish application of 3.5 in to 5.1
and when i run that application locally it runs fine... and
when i use virtual directory to run that project it gives error
object reference not set to the instance of the object..
and 3.5 option also not coming in iis 5.1
please help
umerumerumer
|
|
|
|
|
mr_muskurahat wrote: when i use virtual directory to run that project it gives error
object reference not set to the instance of the object..
Well, that is way too little information to be useful. You have to post the code where the error occurs for the error message to be any helpful.
mr_muskurahat wrote: and 3.5 option also not coming in iis 5.1
There is no separate frameworks with version 3.0 or 3.5. You are still using framework 2.0. They are just additions.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|