|
System.IO.File.Delete("FilePath");
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Thanks
Just one question. Will "FilePath" be the complete path from "C:\" or from within the application path on IIS or server?
EG http://localhost/invoices/mysheet.doc
|
|
|
|
|
Use the actually file path "C:\"
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
You can use Server.MapPath to translate from the relative path to the absolute.
You may run into permissions exceptions, just a heads up.
~A
|
|
|
|
|
It is true, we have a have web farm so we have two IIS servers running the same site. We can't even write files because the account running aspnet doesn't have access to the network drives. Users can't save files to local drives because it is two machines. After 2 years, I finally came up with a work around. I created a web service that impersonates a windows account and accepts a byte array as a parameter. I call the web service to write files to a networked directory that the impersonated account has access to. I should write an article about it.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi all,
I m using asp.net 2.0. I have queried the Database and having all my data in a DataSet (eg 'myDS').
If i ve use GridView control and Bind the DataSet, then the No. of Data Rows displayed in the GridView is same as the No. of Rows in the DataTable of DataSet (myDS).
But i wish to customize the no of GridView Rows, ie Reduce the no of rows. ( Displaying Multiple DataTable Row in a Single Row of GridView.)
For example, the GridView with 3 Columns in a Single row. Each Column Displays respective DataTable Value from myDS. Thereby reducing the no of rows of GridView by 1/3.
Anybody can help me achieve this?
Regards,
Jay
|
|
|
|
|
You can create a new datatable with 1/3 the number of rows. Do something like this.
DataTable dtOriginal = dst.Tables[0];
DataTable dtNew = new DataTable();
DataColumn c1 = new DataColumn();
DataColumn c2 = new DataColumn();
DataColumn c3 = new DataColumn();
string s = "1" ;
c1.ColumnName = "Row1";
c1.DataType = s.GetType();
c2.ColumnName = "Row2";
c2.DataType = s.GetType();
c3.ColumnName = "Row3";
c3.DataType = s.GetType();
dtNew.Columns.Add(c1);
dtNew.Columns.Add(c2);
dtNew.Columns.Add(c3);
int intRowID = 0;
string[] values = new string[3];
foreach (DataRow r in dtOriginal.Rows)
{
switch (intRowID)
{
case 0:
values[0] = r[0].ToString();
intRowID += 1;
break;
case 1:
values[1] = r[1].ToString();
intRowID += 1;
break;
case 2:
values[2] = r[2].ToString();
intRowID = 0;
DataRow rNew = dtNew.NewRow();
rNew[0] = values[0].ToString();
rNew[1] = values[0].ToString();
rNew[2] = values[0].ToString();
dtNew.Rows.Add(rNew);
break;
}
}
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Thanks for your reply. It works fine. But my DataRow contains 4 string values. For that i have used two dimensional Jagged Array and got all the values from first three rows.
For this (Jagged Array values), how can i declare a DataColumn and Bind it to the 4 diff. server controls present in my GridView.
ie. Each Column in the GridView contains 4 no of server cntrols.
I need ur valuable suggestions.. Thanks.
Regards,
Jay
|
|
|
|
|
Put an Html table in your template column. Give each table cell an id and runat="server" then. E.G.
Then use the gridviews RowDataBound event.
gvRowDB(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
DataRowView drv = (DataRowView) e.row.DataItem();
HtmlTableCell td1 =("HtmlTableCell") e.Row.FindControl("td1");
td1.innerText = drv.item["YourColum"].toString();
}
}
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
i have a button that is contain the code that call the stored procedure .
the stored procedure is execute insert sql statment and add record to
the data base that is in sql server .
when i pressed the button the record is added well and go to the database.
the problem is when i click refresh for the browser on this page
the record is added again on the database .
why & how can solve this problem ?
dead
|
|
|
|
|
What happens is when an event gets fired(postback) the event source gets stored and when you clicks on the refresh button then the event gets again fired. One simple way to get rid of the problem is to redirect to the same page after execution of the event.
Best Regards,
Apurva Kaushal
|
|
|
|
|
thank you
this is working well
but the sqldatasource that read from database is dont work when i click refresh and i need to show the last data record inserted .
can i do this ?
dead
|
|
|
|
|
If i have understood your problem correctly then after inserting the data into the database you want to display the inserted data to the user. If this is the case then you can't directly redirect to the same page you send some value in the querystring and then in the load event of the page just check the querystring value if it is present then get the newly inserted data and display it.
Hope it will serve the purpose.
Best Regards,
Apurva Kaushal
|
|
|
|
|
thank you for help
>>>
>>>
dead
|
|
|
|
|
always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
First way is U control duplicate data for DB level.
Second way is U control the key event and take an action.
As U like
|
|
|
|
|
i need to write a code which would retrieve the information about the webcontrols in a webpage. i need to know the count and also what type of controls. i know that System.Reflection namespace can be used. but i do not know what class to use. can anybody help??
Sonu
|
|
|
|
|
Hi Sonu,
Sonu.T wrote: i need to know the count and also what type of controls
You can use the Controls collection of the WebForm to know the count of controls and also you can get the 'Type' objects from this collection. What for you need System.Reflection ?
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
I think Page.Controls collection will solve your problems. You can have all information about collection of web controls placed in a web page along with count.
Neeraj
|
|
|
|
|
I need to create a bunch of feedback web forms that contain pretty much the same basic controls with a few of them having a few extras and was wondering the best aproach to this.
for example: they will all have a text area and a submit button.
but a hand full need some radio buttons or check boxes, etc.
Is there some form of form inheritance I should use?
Or should i make a super form with everything on and set control visability based on a querystring or session variable, etc.
Cheers.
|
|
|
|
|
User controls are you friend. Check msdn or help files.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
To Red_Lizard_Who_Shot_The_Food
User control is what you need to add some basic controls. and you can reuse them in you aspx file.
Thanks & regards,
Suresh Dayma
|
|
|
|
|
Hi,
I’m facing this problem when I create a project by using “ASP.NET Web Application”, the error message is prompt out like this “Visual Studio .NET has detected that the specified Web server is not running ASO.NET version 1.1. You will be unable to run ASP.NET Web applications or services.” I already install the IIS in my PC, why still prompt out this error message? Can anyone of you give me some advice what should I do to solve this problem? Thanks.
|
|
|
|
|
Hi,
Do you have multiple versions of .Net FrameWork installed on machine ? If yes then the default ASP .Net engine is not set to v 1.1. Please confirm this. You can check what version of ASP .Net engine is being used from the ASP .Net tab in the default web site properties.
BTW, is IIS running ? can you access http://localhost ? Please check that IIS is running.
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
Hi Anant,
I have 3 .NET Framework which are .NET Framework 1.1, .NET Framework 1.1 Hotfix(KB886903) and .NET Framework 2.0. So what should I do now? It is I need to uninstall one of the .NET Framework here? Yup, my IIS is running. Please give advance advice on this, thanks.
|
|
|
|