|
Try this
Server.mappath(FileUpload1.Postedfile.FileName)
|
|
|
|
|
hi thanx for respond...
string filePath = Server.MapPath(FileUpload1.PostedFile.FileName);
it takes path where website is there..ie..if i have website in f:\
if i have selecte image in desktop/d drive..it also takes path from f:\ drive only..but that image has in other drive...so bug will come...
pls..help me.......
thank you..........
|
|
|
|
|
Try to put this code for getting the path in the Form_Load()
|
|
|
|
|
Thanks for responce..
string filePath = Server.MapPath(FileUpload1.PostedFile.FileName);
but same problem...it is not taking selected file path...
thank u
|
|
|
|
|
The guy who answered you is more clueless than you are. Ignore him.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Well that's just plainly not going to work. The server part at the start should be a bit of a giveaway...
|
|
|
|
|
Don't answer if you don't know, please.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
qn123 wrote: Sir thank you for respond actually i new to Asp.net
Well, there's a surprise. If you're new to ASP.NET, why are you working so hard on this issue ? Surely you're not writing code that you're paid for ? You're new, so you'd be learning, in a class, or by yourself, right ? So drop the firefox thing, it plainly won't work, and you'd have to be very dishonest to be doing paid work when you're new, so whatever project you're doing for fun, just accept that Firefox doesn't do what you want it to, and move on.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Try this!
string strfile=Path.GetFileName(txtUpload.PostedFile.FileName);
string strdr=Request.PhysicalApplicationPath+"<name of="" the="" folder="">\\";
|
|
|
|
|
I have to add the data directly from the gridview .
so how should i achieve the same
|
|
|
|
|
Abhishek Rana wrote: I have to add the data directly from the gridview .
so how should i achieve the same
Did you search google before posting it over here ?
I have searched got it[^]
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hi there,
Previouly I was desigining my Asp.Net Pages by taking Table.But It gives me problem when I change browser.So now I want to design my pages in div tag.I dont know how to design.Can anybody help me with some usefull link where I can get Information regarding this.
Thanks,
|
|
|
|
|
<div id="myDiv" title="myDiv" align="center" style="border:thick #000000">
Hi Try this Div
</div>
|
|
|
|
|
This[^] site have some tutorials on CSS. You have to take a book on CSS and web design for more details.
|
|
|
|
|
how to export stored procedures from local sql server 2000 to microsoft sql server,
i am sending but that is failed to copy. so plz send me the details.
somasekhar
j somasekhar
|
|
|
|
|
somasekhara777 wrote: how to export stored procedures from local sql server 2000 to microsoft sql server,
You want to mean that, you want to export SQL Server 200 SP to SQL Server 2005 or what?
somasekhara777 wrote: i am sending but that is failed to copy..
How ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
You can script each SP in Sql 2000 with the right mousebuttonclick on the SP name.
If you combine all scripts into 1 large script....run that script on your new database
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hi to all,
I have in a datatable select method. I am unable to find what is going wrong.
Please give some guidance.
I am trying to do like this:
public void get_data()
{
try
{
pro_id = Request.QueryString["pr_id"];
quanti = Convert.ToInt32(Request.QueryString["quant"]);
if (pro_id != null)
{
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;
}
cmd.Connection.Close();
DataRow myrow = dt.NewRow();
myrow["REF"] = id;
myrow["Description"] = desc;
myrow["QTY"] = quanti;
myrow["Price"] = unitprice;
myrow["Cost"] = cost;
int dtcount = dt.Rows.Count;
if (dtcount > 0)
{
DataRow[] arrMatchingValues = dt.Select("REF=" + id);
if (arrMatchingValues.Length > 0)
{
DataRow drUpdateMe = arrMatchingValues[0];
int drUpdateQuant = Convert.ToInt32(drUpdateMe["QTY"]);
int quan = quanti + drUpdateQuant;
drUpdateMe["QTY"] = quan;
dt.AcceptChanges();
}
}
else
{
dt.Rows.Add(myrow);
dt.AcceptChanges();
}
Session["data"] = dt;
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
int a = 1;
}
total_items = total_items + quanti;
total_Price = total_Price + cost;
Session["items"] = total_items;
Session["value"] = total_Price;
}
catch(Exception ee)
{
Lblmsg.Text = ee.Message;
}
}
The problem is in the filter expression. Actually I am trying that if a item already exists in the gridview then only the quantity should be updated.But I am unable to do this.
Please give some suggestions..
cheers,
sneha
|
|
|
|
|
hi.
in this u will get only single row.?
|
|
|
|
|
hi,
I mean to say that suppose user add a item whose product_id is "CB920". Now user again enters the same item then only the quantity should be updated. This code will only work if there will be atleast one row already in the cart.Then when the next item will come this function will check the datatable for the particular row. If found then it will update the quantity otherwise it will add a new row.
This I want to do.
cheers,
sneha
|
|
|
|
|
hi,
Actually what is your task,
DataRow myrow = dt.NewRow();
myrow["REF"] = id;
myrow["Description"] = desc;
myrow["QTY"] = quanti;
myrow["Price"] = unitprice;
myrow["Cost"] = cost;
int dtcount = dt.Rows.Count;
if (dtcount > 0)
{
DataRow[] arrMatchingValues = dt.Select("REF=" + id);
in this code your searching for the id which is added to same datatable previously...
|
|
|
|
|
if your getting any error after debug plz.. write that error..
in this you will get only one row ......
|
|
|
|
|
hi,
Thanks for your response.
Actually it is giving the error in the filter expression term. The error is
"There is no column named [CB920]"
This is id of the product which user is selecting.
cheers,
sneha
|
|
|
|
|
in this first you have to create column for dt.
ex:dt.column.add[...];
after that write this code.
DataRow myrow = dt.NewRow();
myrow["REF"] = id;
myrow["Description"] = desc;
myrow["QTY"] = quanti;
myrow["Price"] = unitprice;
myrow["Cost"] = cost;
|
|
|
|
|
rajmca.g wrote: in this first you have to create column for dt.
ex:dt.column.add[...];
Hi,
But I have five fixed columns(REF,Description,QTY,Price,Cost).And row matching is done as per "REF" column which is already there.
And at the 0th position of the datatable the column name is "REF"
Please tell me which you are talking about.
cheers,
sneha
|
|
|
|