Solution Required

N

nil

I hope someone from u will surely help me.I am new to vb.net and
developing
one web application in vb.net2003.I hope i will have the good response
and advice from all of the members of this group...

problem is like this

I Want to store data temporarily so i created one data table in coding
and each time when user
do data entry one record will be stored in the data table and i m
showing all those entered
record in the data grid so user can modify the records later on if he
wants....

Here i m showing u the coding that i did
============================
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Call data()
txtdate.Text = System.DateTime.Now.Today
End Sub

Private Sub btsave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btsave.Click
'Dim str As String = "INSERT INTO BK_ORDER(ID, BOOK_NAME,
AUTHOR, PUBLICATION, EDITION, QTY, OVENDOR, ODATE, DURATION)
VALUES ('" & txtid.Text & "','" & txtbkname.Text & "','" &
txtauthor.Text & "','" & txtpbl.Text & "','" & txtedition.Text & "','"
& ddlqty.SelectedItem.Value & "','" & txtvendor.Text & "',sysdate , '"
& ddldur.SelectedItem.Value & "')"


Dim dt As New DataTable("Book order")
Dim dr As DataRow = dt.NewRow()

dt.Columns.Add(New DataColumn("ID", GetType(Int32)))
dt.Columns(0).AutoIncrement = True
dt.Columns(0).ReadOnly = True
dt.Columns.Add(New DataColumn("Book Name", GetType(String)))
dt.Columns.Add(New DataColumn("Author", GetType(String)))
dt.Columns.Add(New DataColumn("Publication", GetType(String)))
dt.Columns.Add(New DataColumn("Edition", GetType(Int32)))
dt.Columns.Add(New DataColumn("Qty", GetType(Int32)))
dt.Columns.Add(New DataColumn("Duration", GetType(Int32)))
dt.Columns.Add(New DataColumn("Venodor", GetType(String)))
dr("ID") = txtid.Text
dr("Book Name") = txtbkname.Text
dr("Author") = txtbkname.Text
dr("Publication") = txtbkname.Text
dr("Edition") = txtbkname.Text
dr("Qty") = ddlqty.SelectedItem.Value
dr("Duration") = ddldur.SelectedItem.Value
dr("Vendor") = txtvendor.Text
dt.Rows.Add(dr)
DataGrid1.DataSource = dt
DataGrid1.DataBind()
End Sub
Private Sub btclose_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btclose.Click
Response.Redirect("frmmain.aspx")
End Sub
Private Sub clear()
Call data()
txtbkname.Text = ""
txtauthor.Text = ""
txtpbl.Text = ""
txtedition.Text = ""
txtvendor.Text = ""

Call clear()
End Sub

Private Sub data()
'Dim ds As New DataSet()
'Dim dt As New DataTable("Book order")
'Dim columnid As New DataColumn("Id",
System.Type.GetType("system.int32", False, True))
'Dim columnname As New DataColumn("Book Name",
System.Type.GetType("system.string", False, True))
'Dim columnauthor As New DataColumn("Author",
System.Type.GetType("system.string", False, True))
'Dim columnpbl As New DataColumn("Publication",
System.Type.GetType("system.string", False, True))
'Dim columned As New DataColumn("Edition",
System.Type.GetType("system.int32", False, True))
'Dim columnqty As New DataColumn("Qty",
System.Type.GetType("system.int32", False, True))
'Dim columnvendor As New DataColumn("Vendor",
System.Type.GetType("system.string", False, True))
'Dim columndate As New DataColumn("Date",
System.Type.GetType("system.datetime", False, True))
'Dim columnduration As New DataColumn("Duration",
System.Type.GetType("system.int32", False, True))
'Dim str As String = "select * from bk_order"
''ds = dbconn(str)
'' dt.BeginLoadData()
' txtid.Text = ds.Tables(0).Rows.Count + 1
'DataGrid1.DataSource = ds
'DataGrid1.DataBind()
End Sub

and please note that when user enter record it is stored in the
datatable and when enter
other record then the previous will be overwrite by the second one.I
want to show all the
records in the grid entered by the user..i also checked declaring the
datatable at the top of
the class as global but it didn't work so please tell me what to do?
i am not saving all the data in the database at a time...but all the
records come
in to datatable and then user do modification and then i want to store
it in the database
and i am using oracle..hope someone from you'll help me in this...
and also tell me what is the session and use of it?should i use session
in this?if yes then
how tell me the coding for that....or suggest me any nice and good book
that covers
my problem..thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top