Solution Required

Discussion in 'ASP .Net' started by nil, Nov 17, 2006.

  1. nil

    nil Guest

    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
     
    nil, Nov 17, 2006
    #1
    1. Advertising

  2. nil

    Guest

    Hi nil,

    I suggest this:
    http://tinyurl.com/y6evd7

    Chandy

    nil wrote:

    > 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
     
    , Nov 17, 2006
    #2
    1. Advertising

  3. nil

    nil Guest

    On Nov 17, 7:22 pm, wrote:
    > Hi nil,
    >
    > I suggest this:http://tinyurl.com/y6evd7
    >
    > Chandy
    >
    >
    >
    > nil wrote:
    > > 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- Hide quoted text -- Show quoted text -


    thanks a lot for your help
     
    nil, Nov 19, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TW9oaXQgR3VwdGE=?=

    ASP .NET and ASP style confusion. Immediate solution required

    =?Utf-8?B?TW9oaXQgR3VwdGE=?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    815
    Scott Allen
    Oct 18, 2004
  2. Just D.
    Replies:
    0
    Views:
    455
    Just D.
    Mar 10, 2006
  3. Replies:
    0
    Views:
    458
  4. Proton Projects - Moin

    Logger solution Required

    Proton Projects - Moin, Mar 2, 2007, in forum: Java
    Replies:
    1
    Views:
    301
    Mark Jeffcoat
    Mar 2, 2007
  5. Replies:
    8
    Views:
    340
    Alexey Smirnov
    May 28, 2007
Loading...

Share This Page