3 Replies - 731 Views - Last Post: 09 March 2012 - 12:23 PM Rate Topic: -----

#1 praveenphp  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 20
  • Joined: 18-February 12

How to accept multiple dish orders in asp.net?

Posted 08 March 2012 - 01:29 PM

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
Is This A Good Question/Topic? 0
  • +

Replies To: How to accept multiple dish orders in asp.net?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8940
  • View blog
  • Posts: 33,527
  • Joined: 12-June 08

Re: How to accept multiple dish orders in asp.net?

Posted 08 March 2012 - 02:00 PM

Moving to the ASP.NET forum.
Was This Post Helpful? 0
  • +
  • -

#3 h4nnib4l  Icon User is offline

  • The Noid
  • member icon

Reputation: 1181
  • View blog
  • Posts: 1,673
  • Joined: 24-August 11

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.
Was This Post Helpful? 0
  • +
  • -

#4 praveenphp  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 20
  • Joined: 18-February 12

Re: How to accept multiple dish orders in asp.net?

Posted 09 March 2012 - 12:23 PM

View Posth4nnib4l, 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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1