By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

How to use one datagrid to update/insert into another

P: n/a
I don't care how one suggests I do it, but I've been searching for days
on how to implement this concept. I'm trying to use some kind of grid
control (doesn't have to be a grid control, whatever works best) to
display a dropdown menu of fields populated from table tblInvoiceData.
This control also includes a textbox which the user can input a value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular field and
value displays in a grid (can be this original grid or another), BUT,
does not update the database tables until the user finshes adding all
their fields and then clicks on the UPDATE button, at which point
updates tblInvoiceData for this particular clientID.

HELP!!!

Dec 11 '06 #1
Share this Question
Share on Google+
13 Replies


P: n/a
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegroup s.com...
>I don't care how one suggests I do it, but I've been searching for days
on how to implement this concept. I'm trying to use some kind of grid
control (doesn't have to be a grid control, whatever works best) to
display a dropdown menu of fields populated from table tblInvoiceData.
This control also includes a textbox which the user can input a value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular field and
value displays in a grid (can be this original grid or another), BUT,
does not update the database tables until the user finshes adding all
their fields and then clicks on the UPDATE button, at which point
updates tblInvoiceData for this particular clientID.

HELP!!!

Dec 11 '06 #2

P: n/a
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegroup s.com...
I don't care how one suggests I do it, but I've been searching for days
on how to implement this concept. I'm trying to use some kind of grid
control (doesn't have to be a grid control, whatever works best) to
display a dropdown menu of fields populated from table tblInvoiceData.
This control also includes a textbox which the user can input a value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular field and
value displays in a grid (can be this original grid or another), BUT,
does not update the database tables until the user finshes adding all
their fields and then clicks on the UPDATE button, at which point
updates tblInvoiceData for this particular clientID.

HELP!!!
Dec 11 '06 #3

P: n/a
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
>How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegrou ps.com...
>I don't care how one suggests I do it, but I've been searching for
days
on how to implement this concept. I'm trying to use some kind of
grid
control (doesn't have to be a grid control, whatever works best) to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input a
value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular field
and
value displays in a grid (can be this original grid or another),
BUT,
does not update the database tables until the user finshes adding
all
their fields and then clicks on the UPDATE button, at which point
updates tblInvoiceData for this particular clientID.

HELP!!!

Dec 11 '06 #4

P: n/a
look, I'm not going to argue about this. The whole point of stating my
initial problem was for someone to possibly suggest a concept or
method, if there's something already out there that does something like
this. If not, I gave a specific example of what I'm trying to do.
RobinS wrote:
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegroup s.com...
I don't care how one suggests I do it, but I've been searching for
days
on how to implement this concept. I'm trying to use some kind of
grid
control (doesn't have to be a grid control, whatever works best) to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input a
value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular field
and
value displays in a grid (can be this original grid or another),
BUT,
does not update the database tables until the user finshes adding
all
their fields and then clicks on the UPDATE button, at which point
updates tblInvoiceData for this particular clientID.

HELP!!!
Dec 11 '06 #5

P: n/a
here's the code.

Dim cmdParam As SqlParameter
Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
TextBox).Text
Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) = txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")
dgMassUpdate.EditItemIndex = -1

dgTemp.DataSource = dsMassUpdate
dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
As String) As ICollection
Dim table As New DataTable
Dim tr As DataRow
Dim td As DataColumn
Dim newRow As DataRow
newRow = table.NewRow()

table.Columns.Add(New DataColumn(ddlField, GetType(String)))
table.Columns.Add(New DataColumn(txtValue, GetType(String)))

Dim dv As New DataView(table)
Return dv
End Function
RobinS wrote:
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegroup s.com...
I don't care how one suggests I do it, but I've been searching for
days
on how to implement this concept. I'm trying to use some kind of
grid
control (doesn't have to be a grid control, whatever works best) to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input a
value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular field
and
value displays in a grid (can be this original grid or another),
BUT,
does not update the database tables until the user finshes adding
all
their fields and then clicks on the UPDATE button, at which point
updates tblInvoiceData for this particular clientID.

HELP!!!
Dec 11 '06 #6

P: n/a
oops, here it is again...

Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim cmdParam As SqlParameter
Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
TextBox).Text

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")
dgMassUpdate.EditItemIndex = -1

dgTemp.DataSource = dsMassUpdate
dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
As String) As ICollection
Dim table As New DataTable
Dim tr As DataRow
Dim td As DataColumn
Dim newRow As DataRow
newRow = table.NewRow()

table.Columns.Add(New DataColumn(ddlField, GetType(String)))
table.Columns.Add(New DataColumn(txtValue, GetType(String)))

Dim dv As New DataView(table)
Return dv
End Function
RobinS wrote:
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegroup s.com...
I don't care how one suggests I do it, but I've been searching for
days
on how to implement this concept. I'm trying to use some kind of
grid
control (doesn't have to be a grid control, whatever works best) to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input a
value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular field
and
value displays in a grid (can be this original grid or another),
BUT,
does not update the database tables until the user finshes adding
all
their fields and then clicks on the UPDATE button, at which point
updates tblInvoiceData for this particular clientID.

HELP!!!
Dec 11 '06 #7

P: n/a
Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim cmdParam As SqlParameter
Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
TextBox).Text

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")

dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
As String) As ICollection
Dim table As New DataTable
Dim tr As DataRow
Dim td As DataColumn
Dim newRow As DataRow
newRow = table.NewRow()

table.Columns.Add(New DataColumn(ddlField, GetType(String)))
table.Columns.Add(New DataColumn(txtValue, GetType(String)))

Dim dv As New DataView(table)
Return dv
End Function

Dec 11 '06 #8

P: n/a
Fair enough. I think it came across as one of those really
broad questions, and that's why you got the response you did.

I'll go look at your other posts, and if I can help you, I will.

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
look, I'm not going to argue about this. The whole point of stating
my
initial problem was for someone to possibly suggest a concept or
method, if there's something already out there that does something
like
this. If not, I gave a specific example of what I'm trying to do.
RobinS wrote:
>No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegr oups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegrou ps.com...
I don't care how one suggests I do it, but I've been searching
for
days
on how to implement this concept. I'm trying to use some kind
of
grid
control (doesn't have to be a grid control, whatever works best)
to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input a
value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular
field
and
value displays in a grid (can be this original grid or another),
BUT,
does not update the database tables until the user finshes
adding
all
their fields and then clicks on the UPDATE button, at which
point
updates tblInvoiceData for this particular clientID.

HELP!!!


Dec 11 '06 #9

P: n/a
Well, right off the bat, without completely understanding
everything, this looks like an issue:

dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

If you use Rows(0), it will always put it in the first row.

Is dbMassUpdate your data grid that you are inserting their
selection into? What is dgTemp?

If anybody else out there has an opinion, please feel free to
chime in!

Robin S.
-------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
oops, here it is again...

Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim cmdParam As SqlParameter
Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
TextBox).Text

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")
dgMassUpdate.EditItemIndex = -1

dgTemp.DataSource = dsMassUpdate
dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
As String) As ICollection
Dim table As New DataTable
Dim tr As DataRow
Dim td As DataColumn
Dim newRow As DataRow
newRow = table.NewRow()

table.Columns.Add(New DataColumn(ddlField, GetType(String)))
table.Columns.Add(New DataColumn(txtValue, GetType(String)))

Dim dv As New DataView(table)
Return dv
End Function
RobinS wrote:
>No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegr oups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegrou ps.com...
I don't care how one suggests I do it, but I've been searching
for
days
on how to implement this concept. I'm trying to use some kind
of
grid
control (doesn't have to be a grid control, whatever works best)
to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input a
value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular
field
and
value displays in a grid (can be this original grid or another),
BUT,
does not update the database tables until the user finshes
adding
all
their fields and then clicks on the UPDATE button, at which
point
updates tblInvoiceData for this particular clientID.

HELP!!!


Dec 11 '06 #10

P: n/a
my main dataset is dsMassUpdate which I fill early in early piece of
the code. dgMassUpdate is the first datagrid, where I'm performing the
update to the dataset. dgTemp is the second datagrid which gets
populated with the field and value from the first datagrid.

What I'm trying to do is allow the user to update each field with a
value they enter by updating the dataset and not the database. When
the user is finally finished with selecting all the fields and adding
values for the field to be updated with, THEN they hit the UPDATE
button which updates the db.

The purpose of the second datagrid was just to display what fields and
values the user selected and entered. This data doesn't actually get
updated to the database immediately.

RobinS wrote:
Well, right off the bat, without completely understanding
everything, this looks like an issue:

dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

If you use Rows(0), it will always put it in the first row.

Is dbMassUpdate your data grid that you are inserting their
selection into? What is dgTemp?

If anybody else out there has an opinion, please feel free to
chime in!

Robin S.
-------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
oops, here it is again...

Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim cmdParam As SqlParameter
Dim ddlField As String = CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String = CType(e.Item.FindControl("txtValue"),
TextBox).Text

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")
dgMassUpdate.EditItemIndex = -1

dgTemp.DataSource = dsMassUpdate
dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

Function CreateDataSource(ByVal ddlField As String, ByVal txtValue
As String) As ICollection
Dim table As New DataTable
Dim tr As DataRow
Dim td As DataColumn
Dim newRow As DataRow
newRow = table.NewRow()

table.Columns.Add(New DataColumn(ddlField, GetType(String)))
table.Columns.Add(New DataColumn(txtValue, GetType(String)))

Dim dv As New DataView(table)
Return dv
End Function
RobinS wrote:
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegroup s.com...
I don't care how one suggests I do it, but I've been searching
for
days
on how to implement this concept. I'm trying to use some kind
of
grid
control (doesn't have to be a grid control, whatever works best)
to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input a
value.
These two columns are side by side and not in a vertical layout.

The user then clicks on the "add" button and that particular
field
and
value displays in a grid (can be this original grid or another),
BUT,
does not update the database tables until the user finshes
adding
all
their fields and then clicks on the UPDATE button, at which
point
updates tblInvoiceData for this particular clientID.

HELP!!!
Dec 11 '06 #11

P: n/a
Okay, let me try this again:

dsMassUpdate is your actual dataset that is going to be updated?

dgMassUpdate is a datagrid that shows the dataset dsMassUpdate?
Or does it show a list of fields in dsMassUpdate? So they pick
a field name and put the new value in the textbox and click a
button and it adds it to dgTemp?

Then when they're done, they apply all the updates to the
dataset dsMassUpdate?

Am I understanding your process yet?

Robin S.
-------------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
my main dataset is dsMassUpdate which I fill early in early piece of
the code. dgMassUpdate is the first datagrid, where I'm performing
the
update to the dataset. dgTemp is the second datagrid which gets
populated with the field and value from the first datagrid.

What I'm trying to do is allow the user to update each field with a
value they enter by updating the dataset and not the database. When
the user is finally finished with selecting all the fields and adding
values for the field to be updated with, THEN they hit the UPDATE
button which updates the db.

The purpose of the second datagrid was just to display what fields and
values the user selected and entered. This data doesn't actually get
updated to the database immediately.

RobinS wrote:
>Well, right off the bat, without completely understanding
everything, this looks like an issue:

dsMassUpdate.Tables("MassUpdate").Rows(0).Item(dd lField) =
txtValue

If you use Rows(0), it will always put it in the first row.

Is dbMassUpdate your data grid that you are inserting their
selection into? What is dgTemp?

If anybody else out there has an opinion, please feel free to
chime in!

Robin S.
-------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@j72g2000cwa.googleg roups.com...
oops, here it is again...

Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim cmdParam As SqlParameter
Dim ddlField As String =
CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String =
CType(e.Item.FindControl("txtValue"),
TextBox).Text

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")
dgMassUpdate.EditItemIndex = -1

dgTemp.DataSource = dsMassUpdate
dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

Function CreateDataSource(ByVal ddlField As String, ByVal
txtValue
As String) As ICollection
Dim table As New DataTable
Dim tr As DataRow
Dim td As DataColumn
Dim newRow As DataRow
newRow = table.NewRow()

table.Columns.Add(New DataColumn(ddlField, GetType(String)))
table.Columns.Add(New DataColumn(txtValue, GetType(String)))

Dim dv As New DataView(table)
Return dv
End Function
RobinS wrote:
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegr oups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but
the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegrou ps.com...
I don't care how one suggests I do it, but I've been searching
for
days
on how to implement this concept. I'm trying to use some
kind
of
grid
control (doesn't have to be a grid control, whatever works
best)
to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input
a
value.
These two columns are side by side and not in a vertical
layout.

The user then clicks on the "add" button and that particular
field
and
value displays in a grid (can be this original grid or
another),
BUT,
does not update the database tables until the user finshes
adding
all
their fields and then clicks on the UPDATE button, at which
point
updates tblInvoiceData for this particular clientID.

HELP!!!

Dec 12 '06 #12

P: n/a
That is correct.

RobinS wrote:
Okay, let me try this again:

dsMassUpdate is your actual dataset that is going to be updated?

dgMassUpdate is a datagrid that shows the dataset dsMassUpdate?
Or does it show a list of fields in dsMassUpdate? So they pick
a field name and put the new value in the textbox and click a
button and it adds it to dgTemp?

Then when they're done, they apply all the updates to the
dataset dsMassUpdate?

Am I understanding your process yet?

Robin S.
-------------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
my main dataset is dsMassUpdate which I fill early in early piece of
the code. dgMassUpdate is the first datagrid, where I'm performing
the
update to the dataset. dgTemp is the second datagrid which gets
populated with the field and value from the first datagrid.

What I'm trying to do is allow the user to update each field with a
value they enter by updating the dataset and not the database. When
the user is finally finished with selecting all the fields and adding
values for the field to be updated with, THEN they hit the UPDATE
button which updates the db.

The purpose of the second datagrid was just to display what fields and
values the user selected and entered. This data doesn't actually get
updated to the database immediately.

RobinS wrote:
Well, right off the bat, without completely understanding
everything, this looks like an issue:

dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

If you use Rows(0), it will always put it in the first row.

Is dbMassUpdate your data grid that you are inserting their
selection into? What is dgTemp?

If anybody else out there has an opinion, please feel free to
chime in!

Robin S.
-------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
oops, here it is again...

Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim cmdParam As SqlParameter
Dim ddlField As String =
CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String =
CType(e.Item.FindControl("txtValue"),
TextBox).Text

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")
dgMassUpdate.EditItemIndex = -1

dgTemp.DataSource = dsMassUpdate
dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

Function CreateDataSource(ByVal ddlField As String, ByVal
txtValue
As String) As ICollection
Dim table As New DataTable
Dim tr As DataRow
Dim td As DataColumn
Dim newRow As DataRow
newRow = table.NewRow()

table.Columns.Add(New DataColumn(ddlField, GetType(String)))
table.Columns.Add(New DataColumn(txtValue, GetType(String)))

Dim dv As New DataView(table)
Return dv
End Function
RobinS wrote:
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but
the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegroup s.com...
I don't care how one suggests I do it, but I've been searching
for
days
on how to implement this concept. I'm trying to use some
kind
of
grid
control (doesn't have to be a grid control, whatever works
best)
to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input
a
value.
These two columns are side by side and not in a vertical
layout.

The user then clicks on the "add" button and that particular
field
and
value displays in a grid (can be this original grid or
another),
BUT,
does not update the database tables until the user finshes
adding
all
their fields and then clicks on the UPDATE button, at which
point
updates tblInvoiceData for this particular clientID.

HELP!!!

Dec 12 '06 #13

P: n/a
Yes, dgMassUpdate binds the query that holds all the fields that are
populated in the dropdownlist. dgMassUpdate doesn't actually list
anything. The only thing dgMassUpdate does, event wise, is fire
dgMassUpdate_Insert(). And Yes, you are correct, that event then calls
CreateDataSource(). And then the update button does a update of all
the fields and values they've entered. Would you like me to send you
the actual code, so you can see it?

Thanks, I appreciate the help!

RobinS wrote:
Okay, let me try this again:

dsMassUpdate is your actual dataset that is going to be updated?

dgMassUpdate is a datagrid that shows the dataset dsMassUpdate?
Or does it show a list of fields in dsMassUpdate? So they pick
a field name and put the new value in the textbox and click a
button and it adds it to dgTemp?

Then when they're done, they apply all the updates to the
dataset dsMassUpdate?

Am I understanding your process yet?

Robin S.
-------------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
my main dataset is dsMassUpdate which I fill early in early piece of
the code. dgMassUpdate is the first datagrid, where I'm performing
the
update to the dataset. dgTemp is the second datagrid which gets
populated with the field and value from the first datagrid.

What I'm trying to do is allow the user to update each field with a
value they enter by updating the dataset and not the database. When
the user is finally finished with selecting all the fields and adding
values for the field to be updated with, THEN they hit the UPDATE
button which updates the db.

The purpose of the second datagrid was just to display what fields and
values the user selected and entered. This data doesn't actually get
updated to the database immediately.

RobinS wrote:
Well, right off the bat, without completely understanding
everything, this looks like an issue:

dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

If you use Rows(0), it will always put it in the first row.

Is dbMassUpdate your data grid that you are inserting their
selection into? What is dgTemp?

If anybody else out there has an opinion, please feel free to
chime in!

Robin S.
-------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
oops, here it is again...

Sub dgMassUpdate_Insert(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim cmdParam As SqlParameter
Dim ddlField As String =
CType(e.Item.FindControl("ddlField"),
DropDownList).SelectedValue
Dim txtValue As String =
CType(e.Item.FindControl("txtValue"),
TextBox).Text

dsMassUpdate = Session("dsMassUpdate")
dsMassUpdate.Tables("MassUpdate").Rows(0).Item(ddl Field) =
txtValue

SqlConn.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")
dgMassUpdate.EditItemIndex = -1

dgTemp.DataSource = dsMassUpdate
dgTemp.DataSource = CreateDataSource(ddlField, txtValue)

End Sub

Function CreateDataSource(ByVal ddlField As String, ByVal
txtValue
As String) As ICollection
Dim table As New DataTable
Dim tr As DataRow
Dim td As DataColumn
Dim newRow As DataRow
newRow = table.NewRow()

table.Columns.Add(New DataColumn(ddlField, GetType(String)))
table.Columns.Add(New DataColumn(txtValue, GetType(String)))

Dim dv As New DataView(table)
Return dv
End Function
RobinS wrote:
No, you're asking too broad a question. It's like someone
posted a question "Tell me about Windows Forms". Or "Tell me
about ADO.Net". Well, there are books of over a thousand
pages, how do you answer that in a newsgroup? Go buy a book.

This is a more specific question. Are you adding a row
to the 2nd grid before putting the values in? How are you
putting the values in / adding the information to the grid?
Post that code, and we can help you with it.

Robin S.
----------------------------------------
<sh*****@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Moreso, I think his response is saying I'm asking too specific a
question. I've actually done what you've described there, but
the
problem with that is once the user tries to add another item, it
replaces the first value added to the 2nd grid.

RobinS wrote:
How many times are you going to re-post this? Cor's response
means this: You are asking too broad a question.

If the first control has only one value, use a combobox.
Bind it to your tblInvoiceData. Put a textbox next to it.
Put a button next to that. Add an event handler to the
button.

Put a grid on the bottom. When they click on the <Addbutton,
add a record to the grid.

I think that's what you're going for. Tackle the problems
one at a time. It seems like you're asking us to write the
whole thing for you. I'd do that for you, but you'll have
to send me a billing address... ;-)

Robin S.
-----------------------------
<sh*****@gmail.comwrote in message
news:11********************@73g2000cwn.googlegroup s.com...
I don't care how one suggests I do it, but I've been searching
for
days
on how to implement this concept. I'm trying to use some
kind
of
grid
control (doesn't have to be a grid control, whatever works
best)
to
display a dropdown menu of fields populated from table
tblInvoiceData.
This control also includes a textbox which the user can input
a
value.
These two columns are side by side and not in a vertical
layout.

The user then clicks on the "add" button and that particular
field
and
value displays in a grid (can be this original grid or
another),
BUT,
does not update the database tables until the user finshes
adding
all
their fields and then clicks on the UPDATE button, at which
point
updates tblInvoiceData for this particular clientID.

HELP!!!

Dec 12 '06 #14

This discussion thread is closed

Replies have been disabled for this discussion.