|
metallica_rock10 wrote: try this hope it works
for (int i = 0; i < uploadedFiles.Count-1; i++)
NO. It ignores the last file.
|
|
|
|
|
for (int i = 0; i < uploadedFiles.Count; i++)
{
HttpPostedFile userPostedFile = uploadedFiles[i];
if(userPostedFile.HasFile)
{
userPostedFile.SaveAs(filepath + "\\" + System.IO.Path.GetFileName(userPostedFile.FileName));
}
}
Pradeep Reddy
|
|
|
|
|
hello friends,
I want to add New row to gridview using server code. How to do this?
|
|
|
|
|
Add a new row to the datasource and rebind it. Assume you are using DataTable as data source, then add a new row to this data table instance and bind it again to the grid view.
|
|
|
|
|
|
Hi i ma getting datas in dataset like this format:
Name Date
N1 7-21-2008
N1 7-22-2008
N2 7-21-2008
N2 7-25-2008
N2 7-26-2008
N3 7-24-2008
But i want to bind it in my grid like this:
Name Dates
N1 7-21-2008, 7-22-2008
N2 7-21-2008, 7-25-2008, 7-26-2008
N3 7-24-2008
How to do that?,
Thanks & Regards,
Michel,
please don't forget to vote on the post
|
|
|
|
|
Do it in Item Data Bound Event of grid...this event is fired when u bind grid...
|
|
|
|
|
Plz if u dont mind give some what more explanation or code...,
It will be help full for me
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Try this:
private void dgGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
IDataReader dr;
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
ID = Int32.Parse(e.Item.Cells[0].Text); //get ID
string Dispalydate= "";
dr = //Get those records
while(dr.Read())
{
if(Dispalydate.Length > 0)
{
Dispalydate += ", " + dr[1].ToString();
}
else
{
Dispalydate = dr[1].ToString();
}
}
dr.Close();
e.Item.Cells[1].Text = Dispalydate;
}
}
Hope this helps u...
|
|
|
|
|
Do it with a PIVOT TABLE
1[^]
2[^]
|
|
|
|
|
see my table format, its not possible with pivot
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
DataTable has a Select method. Use that to select name, iterate through the data row array and assign to another datatable in the desired format.
|
|
|
|
|
i am using .net 2005.i do my project in asp.net.
how to refresh access 2003 database when insert new record and delete a record during runtime.
my problem is when i insert new record then concurrently not saved in database but if i close and open the database means new inserted data is there.
so i want to store datas when database is concurrently opened.
|
|
|
|
|
sathyan_8294 wrote: when i insert new record then concurrently not saved in database
I think you will find the record is in the database. You will not see it on the screen until you refresh your data.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hi guys
i have four text boxes and four custom validation controls ,
upon failure of a validation i am showing the erros on a summary validator control, but each of my
custom validator also shows the error message , why ?
i want just summary validator control to show the message , how to do that ?
thanks in advance
hello
|
|
|
|
|
In the design view of your page you can adjust the validation controls to show nothing or just leave the error message section blank.
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
Display="None" on the Validation Control
|
|
|
|
|
Hell EveryBody,
I have a webservice in a server.And in another server I have a webApplication. When i use the webmethod of the webservice in my webApplication I got the following error.
I had already used this code, but no result.
webservLeave.PreAuthenticate = false;
webservLeave.Credentials = System.Net.CredentialCache.DefaultCredentials;
or
webservLeave.Credentials = System.Net.CredentialCache.DefaultCredentials;
The request failed with HTTP status 401: Unauthorized
plz help me out.
A key to every Solution
|
|
|
|
|
Is it possible to generate reports in asp.net
|
|
|
|
|
n.sa.vivek wrote: Is it possible to generate reports in asp.net
Yes
|
|
|
|
|
Perfect answer. You got my 5.
|
|
|
|
|
http://msdn.microsoft.com/en-us/library/aa479018.aspx
|
|
|
|
|
|
Yes u can better way is to use Crystal reports.
http://aspdotnetnstuff.blogspot.com
|
|
|
|
|
Hi guys, actually in my aspx page, i created runtime excel files using dynamic grid control...,
The code looks like this......,
System.Web.UI.WebControls.DataGrid grid = new System.Web.UI.WebControls.DataGrid();
grid.DataSource = DS.Tables[i];
grid.DataBind();
foreach (DataRow dr1 in DS.Tables[i].Rows)
{
foreach (DataRow dr2 in DS.Tables[i+1].Rows)
{
if (dr1["MID"].ToString() == dr2["MID"].ToString())
{
if (!Directory.Exists(_path + "\\" + dr1["MID"].ToString() + @"\"))
{
Directory.CreateDirectory(_path + "\\" + dr1["MID"].ToString() + @"\");
string _XLSPATH = _path + "\\" + dr1["MID"].ToString() + "\\" + DS.Tables[i].TableName + ".xls";
using (StreamWriter sw = new StreamWriter(_XLSPATH))
{
using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
grid.RenderControl(hw);
}
}
}
for this i have implemented, using web.ui,htmlcontrols and webcontrols...,
Now same functions i am trying to do in console application........,
Here UI interface i wont get...,
So how i can create grid and directory files for console application?
To solve this probs Any other way is there?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|