Hi.....
Please any one give me some idea.... I want develop a web application in asp.net for a restaurant. That web application should accept orders from users. But i dont know how to accept multiple dish orders to insert into database.
Means how to save temporarily in webpage before saving in database? for the user to edit and display the orders dish items.
Thanks and Reagrds
praveen
How to accept multiple dish orders in asp.net?
Page 1 of 13 Replies - 467 Views - Last Post: 09 March 2012 - 12:23 PM
Replies To: How to accept multiple dish orders in asp.net?
#2
Re: How to accept multiple dish orders in asp.net?
Posted 08 March 2012 - 02:00 PM
Moving to the ASP.NET forum.
#3
Re: How to accept multiple dish orders in asp.net?
Posted 08 March 2012 - 03:41 PM
You could store 'Order' objects in cookies or the cache.
#4
Re: How to accept multiple dish orders in asp.net?
Posted 09 March 2012 - 12:23 PM
h4nnib4l, on 08 March 2012 - 03:41 PM, said:
You could store 'Order' objects in cookies or the cache.
<code>
Public Partial Class Orders
Inherits System.Web.UI.Page
Dim ds As New DataSet
Dim dt As New DataTable
Dim id As Integer
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim dc As New DataColumn("dtype")
Dim dc1 As New DataColumn("dcat")
dt.Columns.Add(dc)
dt.Columns.Add(dc1)
ds.Tables.Add(dt)
Session("data") = ds
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
databinds()
End Sub
Private Sub databinds()
Dim dr As DataRow
ds = Session("data")
dr = ds.Tables(0).NewRow
dr(0) = TextBox1.Text
dr(1) = TextBox2.Text
ds.Tables(0).Rows.Add(dr)
GridView1.DataSource = ds
GridView1.DataBind()
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click
End Sub
Private Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
MsgBox(index)
' Dim gvRow As GridViewRow = GridView1.Rows(index)
' MsgBox(gvRow)
id = index
MsgBox(GridView1.SelectedIndex)
End Sub
Private Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
dt = GridView1.DataSource
dt.Rows(e.RowIndex).Delete()
GridView1.DataSource = dt
GridView1.DataBind()
End Sub
End Class
</code>
I am doing this much... can u help me.. how to delete a particular row if i dont want in gridview...
My code is working for adding data but i am unable to delete the row
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote








|