|
are you talking about mail attachment?
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
|
Respected ,
Yes,Sir But why you not Reply....
Thanks
|
|
|
|
|
|
Hi,
I have a developed a mobile client application for which i wants to make a server application.
I have my website which have a database to it and i wants that both server application and my website will share the same database.
The main feature of the server application i to make continuous http request to a URL and capture the response and perform according to the response.
But i dont know what to do in this regards, i am totally stucked to this please help me what to do.
which kind of application i have to make either web application or web services & how i will integrate it to my website.
Thanks in advance
|
|
|
|
|
Hi Rahul,
If ur Server application only makes continous request to the URL and get the output ,
Make it as a WebService which you can call through ur Web Site using Web Reference .
|
|
|
|
|
hii all
m working on shopping cart using csharp.
m retaining the products in datatable and finally then m showing this product in datalist(cart).
but the problem is that the datatable only keeps single row.
whenever i use to add new product to cart the old one is not shown only recently added product is shown.
plz guide where m i wrong.how to retain multiple rows in datatable.i used session but no change.
thnks...
|
|
|
|
|
Hi ......
I believe that somewhere in your code you are overwriting the DataTable without preserving the older records .
Most possible place is where you are adding a new row,
just debug your code or post relevent pieces here ,
|
|
|
|
|
 this is the page wr my cart is shown name cart.aspx....
public partial class mycart : System.Web.UI.Page
{
DataTable dt =new DataTable();
DataView cartview;
protected void Page_Load(object sender, EventArgs e)
{
Getsource();
if(!IsPostBack)
{
Bindlist();
}
}
void Bindlist()
{
DataList1.DataSource = cartview;
DataList1.DataBind();
Session["cart"] = dt;
}
void Getsource()
{
dt = (DataTable)Session["cart"];
cartview = new DataView(dt);
return;
}
protected void Update(object source, DataListCommandEventArgs e)
{
int ProductID = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex]);
TextBox txtqty;
txtqty = ((TextBox)e.Item.FindControl("txtqty"));
string connectionstring = ConfigurationManager.ConnectionStrings["SilverOnline"].ConnectionString;
SqlConnection conn = new SqlConnection(connectionstring);
SqlCommand cmd = new SqlCommand("Update Home Set ProductQty=@productqty Where ProductID=@productid", conn);
cmd.Parameters.Add("@productqty", SqlDbType.VarChar).Value = txtqty.Text;
cmd.Parameters.Add("@productid", SqlDbType.Int).Value = ProductID;
if (conn.State == ConnectionState.Closed)
conn.Open();
cmd.ExecuteNonQuery();
if (conn.State == ConnectionState.Open)
conn.Close();
DataList1.EditItemIndex = -1;
Bindlist();
}
protected void Delete(object source, DataListCommandEventArgs e)
{
string name = ((Label)e.Item.FindControl("Label1")).Text;
cartview.RowFilter = "ProductName='" + name + "'";
if (cartview.Count > 0)
{
cartview.Delete(0);
}
cartview.RowFilter = "";
DataList1.EditItemIndex = -1;
Bindlist();
}
}
on my addcart.aspx page m adding that particular product to cart....the code is...
protected void Button1_Click(object sender, EventArgs e)
{
DataList1.Visible = false;
Button1.Visible = false;
GridView1.Visible = true;
string str = Request.QueryString["ProductID"];
int i = Convert.ToInt16(str);
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SilverOnline"].ConnectionString);
string str1 = "Select * From Home Where(ProductID='" + str + "')";
SqlCommand cmd = new SqlCommand(str1, conn);
SqlDataReader dr = null;
conn.Open();
dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
while (dr.Read())
{
dt.Columns.Add("ProductID", typeof(int));
dt.Columns["ProductID"].AutoIncrement = true;
dt.Columns["ProductID"].AutoIncrementSeed = 100;
dt.Columns.Add("ProductName", typeof(string));
dt.Columns.Add("ProductImg", typeof(string));
dt.Columns.Add("ProductPrice", typeof(string));
dt.Columns.Add("ProductQty", typeof(string));
DataRow row = dt.NewRow();
row["ProductName"] = dr["ProductName"].ToString();
row["ProductImg"] = dr["ProductImg"].ToString();
row["ProductPrice"] = dr["ProductPrice"].ToString();
row["ProductQty"] = 1;
dt.Rows.Add(row);
Session["cart"] = dt;
}
conn.Close();
Response.Redirect("mycart.aspx");
}
|
|
|
|
|
Where are you adding a new row to the DataTable???
|
|
|
|
|
Sir ,
On Button1_Click you are creating a new DataTable .....no where you are retrieving DaTatable from Session,
So How is it suppose to Take the older rows ???
|
|
|
|
|
"Technically", the bug is here (your assigning a whole new datatable as your Session["cart"] object).
mylogics wrote: dt.Rows.Add(row);
Session["cart"] = dt;
If your Session["cart"] schema is the same as dt just do:
((DataTable)Session["cart"]).Rows.Add(row);
But the whole thing is veerrry messsssyy....
Come on man, ever heard of Sql injection?
I see you use parameters in your Update method, good - use them all round your code, better yet, turn those sql strings into stored procedures.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi Coders,
How can I store a 1 or 2 minutes long Video in Database and run in flash player in a Asp.net website.I Google a lot but all in vain.
any help would be appreciated.
Thanks in Advance
Amit Gautam
|
|
|
|
|
Sure - just make a page that returns the bytes of the video and takes an ID on the URL to choose the file. Then point your flash player to that url
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Graus
I can find the ID to run the specific clip but unable to connect with player.
Could u provide me code.
Amit Gautam
|
|
|
|
|
Hiii....
I have created on desktop application using c# and sql server 2005. Now I want the same application to be Web Enabled. So how should I start with it? What are different ways to do it?
Please help..
Thanks in advace...
|
|
|
|
|
YOu need to rewrite it. Hopefully you built it in tiers so all you need to redo is the presentation layer.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
how can i user WebServices in it??
|
|
|
|
|
Swati_g1985 wrote: how can i user WebServices in it??
Just As Same..!
Website-->
Add Web Reference
--Url
Add--
If You Did'nt Got my solution
Search Calling WebServices From Asp.net
You Will get Lots of Support..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi friends,
I want to know
How to Redirect from one page eg: 1.aspx of a one project to another page like 2.aspx of another project in same solution,when we click on a link of 1.aspx?
Can any one tell me?
In how many ways we can get that and which will be the better one?
Thankyou In Advance
|
|
|
|
|
This depends on How these projects are conifigred in Virtual Directory on IIS in Server
|
|
|
|
|
You can use Response.Redirect("your navigate page here");
|
|
|
|
|
Ya i know that
Still i need few ways to get that like thru code not giving directly like response.redirect("http://www.microsoft.com");
Thats y i mentioned in the Question that in how many ways we can get that?n which will be better?
|
|
|
|
|
Hello friends,
I have to display subtotal, vat,total in gridview footer. I am doing like this but nothing is displayed.
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" <br />
CellPadding="4" Font-Names="Verdana" Font-Size="Small" ForeColor="#333333" <br />
PageSize="900" Width="600px" EmptyDataText="No items in your cart!!" <br />
DataKeyNames="REF" GridLines="None" ShowFooter="True" <br />
onrowdatabound="GridView1_RowDataBound"><br />
<FooterStyle BackColor="#1C5E55" ForeColor="#FFFFFF" Font-Bold="True" /><br />
<RowStyle BackColor="#E3EAEB" /><br />
<Columns><br />
<asp:BoundField DataField="REF" HeaderText="REF" SortExpression="REF" <br />
ItemStyle-Width="60px" ><br />
<ItemStyle Width="60px"></ItemStyle><br />
</asp:BoundField><br />
<asp:TemplateField HeaderText="product_id" Visible="False"><br />
<ItemTemplate><br />
<asp:Label ID="lblProduct_Id" runat="server" Text='<%# Eval("REF") %>'></asp:Label><br />
</ItemTemplate><br />
</asp:TemplateField><br />
<br />
<asp:BoundField DataField="Description" HeaderText="Description" <br />
SortExpression="Description" ItemStyle-Width="300px" ><br />
<ItemStyle Width="300px"></ItemStyle><br />
</asp:BoundField><br />
<asp:TemplateField HeaderText="Description" Visible="False"><br />
<ItemTemplate><br />
<asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description")%>' ></asp:Label><br />
</ItemTemplate><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderText="QTY"><br />
<ItemTemplate><br />
<asp:TextBox ID="TxtQTY" runat="server" Width="30px" Text='<%# Eval("QTY") %>' /><br />
</ItemTemplate><br />
</asp:TemplateField><br />
<br />
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" <br />
ItemStyle-Width="80px" ><br />
<ItemStyle Width="80px"></ItemStyle><br />
</asp:BoundField><br />
<asp:TemplateField HeaderText="Price" Visible="False"><br />
<ItemTemplate><br />
<asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price")%>' ></asp:Label><br />
</ItemTemplate><br />
</asp:TemplateField><br />
<br />
<asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" <br />
ItemStyle-Width="80px" ><br />
<ItemStyle Width="80px"></ItemStyle><br />
</asp:BoundField><br />
<asp:TemplateField HeaderText="Cost" Visible="False"><br />
<ItemTemplate><br />
<asp:Label ID="lblCost" runat="server" Text='<%# Eval("Cost")%>' ></asp:Label><br />
</ItemTemplate><br />
<FooterTemplate><br />
<asp:Label ID="lblSubTotal" runat="server" ForeColor="#ffffff" /><br />
</FooterTemplate><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderText="Select"><br />
<ItemTemplate><br />
<asp:CheckBox ID="chkSelection" runat="server" /><br />
</ItemTemplate><br />
</asp:TemplateField><br />
</Columns><br />
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /><br />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /><br />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /><br />
<EditRowStyle BackColor="#7C6F57" /><br />
<AlternatingRowStyle BackColor="White" /><br />
</asp:GridView><br />
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblCost = (Label)e.Row.FindControl("lblCost");
float price = float.Parse(lblCost.Text);
tprice += price;
}
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lblSubTotal = (Label)e.Row.FindControl("lblSubTotal");
lblSubTotal.Text = tprice.ToString();
}
}
Please assist where I am doing wrong...
cheers,
sneha
|
|
|
|
|
Hi Sneha
you need to basically debug the GridView1_RowDataBound function.
In my opinion
Label lblSubTotal = (Label)e.Row.Cells[4].FindControl("lblSubTotal");
|
|
|
|