|
can ASP code be reused.????
If U Get Errors U Will Learn
If U Don't Get Errors U Have Learnt
|
|
|
|
|
If you're a serious sadist then probably.
If you value your sanity just port the important bits over to .NET
|
|
|
|
|
Hi all
I am new to .net. I am dynamically adding Dropdownlist in my form. But i dont do this in (!Postback) event as i want this control to be added even if the Page Postbacks. But now whenever Page PostBacks DropDownList Selected Index is set to 0. So can someone tell me how to solve this problem..
|
|
|
|
|
You want the dropdownlist to populate on page load dont you?try that
|
|
|
|
|
Ya i want it to populate in pageload. I have done that but the problem is that everytime page loads , Dropdownlist selected index is set to 0. I want to laod this contol everytime page loads but also want to get its selected value. How can i do dat...
|
|
|
|
|
hai
I want to upload a large file in asp.net 2.0.
code:
FileInfo fInfo = new FileInfo(filename);
long numBytes = fInfo.Length;
FileStream fStream = new FileStream(filename,
FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fStream);
byte[] data = br.ReadBytes((int)numBytes);
br.Close();
MemoryStream ms = new MemoryStream(data);
FileStream fs = new FileStream(Server.MapPath("~/TargetFolder/") + fInfo.Name, FileMode.Create);
ms.WriteTo(fs);
ms.Close();
When I upload a file [File SIZE :85 MB], it shows
"Insufficient system resources exist to complete the requested service"
Anyone known about this, help me
Thanks in Advance
|
|
|
|
|
Hi All,
Iam using OWC10 component for creating PIE Chart. While creating Pie chart, values are overlapping.
Is it possible to specify the values with line kind of thing?
Thanks.
Thanks & Regards
Kumaran
|
|
|
|
|
Yes, that IS a sad face...
What I want to try and do is to stop a button from posting, and therefore stop refreshing the page.
Is this possible?
(And yes, it HAS to be an <asp:button )<br="" mode="hold">
Weird Question, I know :p
|
|
|
|
|
Yes.
myButton.Attributes.Add("onclick", "return false;")
will run the javascript there on the client click and stop the postback.
|
|
|
|
|
Hi,
I want to copy one datareader dr to another datareader dr1.
I am using while loop to get one by one value from dr
and I want to copy into dr1.
How can I do this.
Thanks
|
|
|
|
|
|
I am binding dr1 to datalist in which image will be there.
I am fetching one by one record from the database where while loop is there and then depending upon that value it taken from the database as dr1 and then I am binding to the datalist dgBindImage.
But Datalist which contains images that display last image.
That overwrite the previous one.
So I want to add or copy dr1 to another dr2 so that direct whole dr2 can be bind to datalist.
cmd = new SqlCommand("SELECT * from Product_price where category_id=" + CatID, cn);
cn.Open();
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
string PID = dr["product_id"].ToString();
cmd1 = new SqlCommand("SELECT * from t_Product where product_id=" + PID, cn1);
cn1.Open();
dr1 = cmd1.ExecuteReader();
SqlDataReader myReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
dr1.Close();
cn1.Close();
}
dgBindImage.DataSource = dr1;//dgBindImage is Datalist
dgBindImage.DataBind();
}
|
|
|
|
|
I presume this is in relation to your previous post.
Try setting the CommandBehavior on the inner DataReader:
SqlDataReader myReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
|
|
|
|
|
Thanks for the information.But
The Problem is like below
I am binding dr1 to datalist in which image will be there.
I am fetching one by one record from the database where while loop is there and then depending upon that value it taken from the database as dr1 and then I am binding to the datalist dgBindImage.
But Datalist which contains images that display last image.
That overwrite the previous one.
So I want to add or copy dr1 to another dr2 so that direct whole dr2 can be bind to datalist.
cmd = new SqlCommand("SELECT * from Product_price where category_id=" + CatID, cn);
cn.Open();
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
string PID = dr["product_id"].ToString();
cmd1 = new SqlCommand("SELECT * from t_Product where product_id=" + PID, cn1);
cn1.Open();
dr1 = cmd1.ExecuteReader();
SqlDataReader myReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
dr1.Close();
cn1.Close();
}
dgBindImage.DataSource = dr1;//dgBindImage is Datalist
dgBindImage.DataBind();
}
|
|
|
|
|
The line of code from my previous post was a demonstration of how to set a CommandBehavior on the ExecuteReader method. Copying and pasting it directly into your code in this way will have no effect. You need to apply it to your datareader.
To solve your problem with overwriting the previous image, you need to create a new dgBindImage control for each iteration of the loop. You can do this by nesting it inside another list control and calling your code inside the row data bound event of the list control.
|
|
|
|
|
Hi All,
How to use the splitter control in web form. I'm using asp.net 2.0 How to do this? Give me any sample.
I searched in google, I found free vwd-cms, But I want to create it.
How to do this?
Thanks in advance
|
|
|
|
|
Check out this article: ASP.NET Splitter Bar[^]. By looking through the javascript file VwdCmsSplitterBar.js you get some idea of how to create it.
|
|
|
|
|
Thanks.I saw that one.Is it a thirdparty s/w?
Shall I use in my application?
|
|
|
|
|
Have a read of the license associated with the article, there is a link near the end of the article.
|
|
|
|
|
Hi all
i have gird view set auto generate fields is true
How can i visible column on gridview. So dont remove column on Datatable.
|
|
|
|
|
Hi,
I got the following error while binding radscheduler to a Sqldatasource.Please solve this problem for me...
DataBinding: 'System.Char' does not contain a property with the name 'ID'.
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: DataBinding: 'System.Char' does not contain a property with the name 'ID'.
Source Error:
Line 17:
Line 18: Me.RadScheduler1.DataSource = "SqlDataSource1"
Line 19: RadScheduler1.DataBind()
Line 20: RadScheduler1.DataSource = String.Empty
Line 21
thank you
|
|
|
|
|
Hi,
From the Following Code when Executing the statement
dr1 = cmd1.ExecuteReader();
It shows me error that There is already an open DataReader associated with this Command which must be closed first.
cmd = new SqlCommand("SELECT * from Product_price where category_id=" + CatID, cn);
cn.Open();
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
string PID = dr["product_id"].ToString();
cmd1 = new SqlCommand("SELECT * from t_Product where product_id=" + PID, cn);
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
else
{
dr1 = cmd1.ExecuteReader();
dgBindImage.DataSource = dr1;
dgBindImage.DataBind();
}
}
}
How to solved this error
|
|
|
|
|
A DataReader should be closed when you are finished using it, to free up resources.
When you read the first row you are opening dr1 and binding to dgBindImage, that DataReader is still open and using the cmd1 object when you read the second row.
To solve the error you need to close the DataReader when you are finished with it.
|
|
|
|
|
But Every time I want the value from dr
|
|
|
|
|
That is fine for the first DataReader which you have called "dr".
For the second DataReader, which you have called "dr1", each iteration of the loop is a separate call of cmd1.ExecuteReader(); so you need to close off this reader before calling it again.
|
|
|
|