|
Hi guys i am uploading one excel file and read the datas and storing in to my database table...,
First time its going on well, in the second time the same excel file if i upload once again :
I am getting the error msg as:
"The process cannot access the file 'E:\Files\file.xls' because it is being used by another process. "
whats the problem plz guide me how to solve this one
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Make sure you are properly releasing all the streams/resources you use when you have opened the file in the first place.
|
|
|
|
|
Hi,
I have a dropdownlist and datagrid on same page. I am able to show the data in grid on selection change in dropdownlist. thats not a problem. What I want now is to show the datagrid on new page rather than same page. By using selection change and button. any suggestion, what I am missing.
|
|
|
|
|
Just pass the id from your dropdown list in the querystring to your new page and bind the grid there.
|
|
|
|
|
thanks, problem resolved
|
|
|
|
|
try using querystring.
take the button as html button....
<input type="button" id="button1" value="Click" onclick="return Show();" />
<script language="javascript">
function Show()
{
var dropdown=document.getElementById('DropDownList1.ClientID');
var val=dropdown.options[dropdown.selectedIndex].value;
window.open('newpage.aspx?val=' + val);
}
</script>
Now on page load event of new page handle the querystring and do what you want to.
ARINDAM
|
|
|
|
|
Hi I have developed an asp.net website.In my site there is a secured page in which there is a link of a confidential document(say confidential.pdf),which only authenticated users can download.Upto this point it's ok.
My problem is that whenever I go to google and search for confidential.pdf, it shows the link of my file and from there it's easily downloadable.I want to protect this.
Can anyone guide me?
Thanx and regards
ARINDAM
|
|
|
|
|
|
I have done what the link said.Still I am able to search that confidential file using google search.
ARINDAM
|
|
|
|
|
It takes some time for google's index to update itself. It doesn't actually search the entire web every time you click the button...
You might want to look at implementing a more secure authentication mechanism for your files.
|
|
|
|
|
I GridView I added the button "Send Mail"
Now "Send Mail" button starts appearing on each rows .
When i click on that button based on row value i want
do some processing .
Please tell in which event and how to do that.
Please help me to write start up code...
|
|
|
|
|
I think you can use Rowcommand event. This you have mentioned in the subject line also but have not mentioned that what exactly is the problem you are getting.
Apurva Kaushal
|
|
|
|
|
On RowDataBound event set some Id value to HiddenField in each row. And then on the button click event you can check for the hiddenField's value and then take appropriate action, meant particularly for that row.
|
|
|
|
|
I have a web application (ASP.NET 2.0) that is published on three servers (all working against one database). When I run the code below I got an ArgumentOutOfRangeException on just one of my webbservers. Very strange…
All tips of where to start finding the error source are welcomed. I’m running IIS 6.0 and .NET 2.0. It fells like a IIS configuration of handling exceptions… or?
public static DataRow Process(DataRow source0, DataRow source1, List<ProcessItemHandler> handlers)
{
DataRow target = source0.Table.NewRow();
foreach (DataColumn column in source0.Table.Columns)
{
int n = column.Ordinal;
ProcessItemHandler handler = handlers[n];
…
_____________________________
...and justice for all
|
|
|
|
|
At some point your handlers collection doesn't have an item at 'n'. Put some exception handling here and log your error in some fashion to allow you to figure out what the problem is.
|
|
|
|
|
Found the problem. The handler-array was static and was initialized in two different ways depending on which page that was launched firs after an iisreset.
Hopefully the problem is solved.
_____________________________
...and justice for all
|
|
|
|
|
Hello friends,
I am displaying my reports in pdf format..This reports are opened in Acrobat Reader 7.0..This is working right on my pc..but on client machine it is giving error..of 'Access Denied'..Is there any setting in IIS to allow pdf file to show or it is the problem of the Acrobat REader?
Help me..guys...Thank you..
|
|
|
|
|
It is most likely a file permission problem. On your development machine you will be running as yourself (if you are running Visual Studio's built in web server). On IIS your web application will be running in a protected/restricted account.
Does the directory that contain the PDFs permit IIS to read its contents? (You can find out which account IIS is using by going to the properties for the website/virtual directory in IIS and selecting the "Directory Security" tab. Then pressing the "Edit..." button in "Anonymous access and authentication control" and seeing what the settings are.
|
|
|
|
|
Hi to all,
I have a problem in updating the datagrid.
The scenerio is: I am having a datagrid on my page.I am basically working on shopping cart.Whenever user selects any the product it should be displayed in the datagrid(ie my cart).Suppose the user continues the shopping and he again selects one of the product.Then it should be added below the first row in the datagrid.
But I am not getting this result.Whenever I add another item in my cart ,it will replace the previous one.
I have tried it as:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Cart"] == null)
{
get_data();
Session["Cart"] = dt;
}
else
{
dt = (DataTable)Session["Cart"];
get_data();
}
}
public void get_data()
{
dt = new DataTable();
dt.Columns.Add("REF", typeof(string));
dt.Columns.Add("Description", typeof(string));
dt.Columns.Add("QTY", typeof(int));
dt.Columns.Add("Price", typeof(float));
dt.Columns.Add("Cost", typeof(float));
pro_id = Request.QueryString["pr_id"];
quanti = Convert.ToInt32(Request.QueryString["quant"]);
SqlConnection con = new SqlConnection("Server=.; Database=eclsc; Trusted_Connection=yes");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select ICEMACHINES.product_id,ICEMACHINES.sh_desc,ICEMACHINES.price from ICEMACHINES where ICEMACHINES.product_id LIKE @product_id union select GLASSWARE.product_id,GLASSWARE.sh_desc,GLASSWARE.price from GLASSWARE where GLASSWARE.product_id LIKE @product_id ";
cmd.Parameters.Add("@product_id", SqlDbType.NVarChar, 50).Value = pro_id;
cmd.Connection.Open();
SqlDataReader rdr = cmd.ExecuteReader();
ArrayList arRole1 = new ArrayList();
while (rdr.Read())
{
desc = (rdr["sh_desc"]).ToString();
id = (rdr["product_id"]).ToString();
unitprice = Convert.ToSingle((rdr["price"]));
cost = unitprice * quanti;
arRole1.Add(rdr["product_id"]);
arRole1.Add(rdr["sh_desc"]);
}
cmd.Connection.Close();
DataRow myrow = dt.NewRow();
myrow["REF"] = id;
myrow["Description"] = desc;
myrow["QTY"] = quanti;
myrow["Price"] = unitprice;
myrow["Cost"] = cost;
dt.Rows.Add(myrow);
dt.AcceptChanges();
DataGrid2.DataSource = dt;
DataGrid2.DataBind();
}
Please give me some idea where I am lacking.
Thanks in advance!
cheers,
sneha
|
|
|
|
|
sneha Choudhary wrote: dt = (DataTable)Session["Cart"];
get_data();
I suppose dt is a page level DataTable
You are fetching it from session and assigning to dt
sneha Choudhary wrote: public void get_data()
{
dt = new DataTable();
Then in your function get_data you are reallocating memory
dt = new DataTable();
The above line will clear reallocate memory to datatable and hence destroy all the previous values
At last
sneha Choudhary wrote: if (Session["Cart"] == null)
{
get_data();
Session["Cart"] = dt;
}
You are overwriting session.
Trouble is in line
dt = new DataTable();
|
|
|
|
|
Hi,
I want to display a list of n(might cross 100) number of items on the page in a ListBox.
But just for the convenience of the user, I want each ListBox item with a checkbox. So that the user can easily select multiple items & he doesn't need to keep pressed ctrl key while selecting multiple items. There is a control CheckedListBox,but it is available for Windows forms only,and not in ASP.Net.
How can I achieve my requirement?Kindly give some guidance.
Thank You.
|
|
|
|
|
what exactly you want to do.
cheers,
sneha
|
|
|
|
|
sneha Choudhary wrote: what exactly you want to do
He want to do CheckBox List like This[^]
|
|
|
|
|
First of all I want know that Why your trying to do this ? If there is more than 100 Chekbox , How many of them user will select ? So first think about your design !!
Now come back to your Solution. If I am not wrong you want some thing This[^](Check Langauge, Platform, Technology.. Section ) .
There are multiple approaches to solve this .
1. You can create them at runtime, placed it inside a Div, which should have scroll option. [ Performance overhead is there ]
2. Simple way to use GridView, use Check box Template Field .
3. Create your own custom control.
|
|
|
|
|
Hey,thanx for your reply. Well,by default all the items(may be 5-100) will be selected. But,just wanted to allow the user to disselect any item,if he wants to. Otherwise there is no compulsion of having such design.
Anyways,thanx for those suggestions .I'll try to get the desired output using them.
|
|
|
|