473,386 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Simple question

I get from database something like this:

DAY HOUR PRICE
---------------------------------------------
MONDAY 10 100
MONDAY 11 120
MONDAY 12 130
MONDAY 13 140
MONDAY 14 150
TUESDAY 11 90
TUESDAY 13 100
TUESDAY 15 110
TUESDAY 17 120
TUESDAY 18 130
TUESDAY 19 140
.....................

Now, I would like to show this on the page like this:

TIME AND PRICE FOR MONDAY
--------------------------------------------
Time:10 Price:100 DELETE button
Time:11 Price:120 DELETE button
Time:12 Price:130 DELETE button
Time:13 Price:140 DELETE button
Time:14 Price:150 DELETE button

TIME AND PRICE FOR TUESDAY
--------------------------------------------
Time:11 Price: 90 DELETE button
Time:13 Price:100 DELETE button
Time:15 Price:110 DELETE button
Time:17 Price:120 DELETE button
Time:18 Price:130 DELETE button
Time:19 Price:140 DELETE button

and so on.

When user clicks DELETE button, the row is removed and deleted from the
database.
What is the best way to do this?

Data grid or data repeater?

Any example? I don't know how to construct it. In asp it was easy with
response.write method and recordset

Thank you,
S
Nov 18 '05 #1
3 1746
Hi Simon,

The Best way i would choose is to play around with the DataSet in which you
have the Data
loop through the Dataset col / row collection in fashion that you want to
display. and build a new dataset and bind to Datagrid.

Thanks
Raghvendra

"simon" <si*********@stud-moderna.si> wrote in message
news:uA**************@TK2MSFTNGP10.phx.gbl...
I get from database something like this:

DAY HOUR PRICE
---------------------------------------------
MONDAY 10 100
MONDAY 11 120
MONDAY 12 130
MONDAY 13 140
MONDAY 14 150
TUESDAY 11 90
TUESDAY 13 100
TUESDAY 15 110
TUESDAY 17 120
TUESDAY 18 130
TUESDAY 19 140
....................

Now, I would like to show this on the page like this:

TIME AND PRICE FOR MONDAY
--------------------------------------------
Time:10 Price:100 DELETE button
Time:11 Price:120 DELETE button
Time:12 Price:130 DELETE button
Time:13 Price:140 DELETE button
Time:14 Price:150 DELETE button

TIME AND PRICE FOR TUESDAY
--------------------------------------------
Time:11 Price: 90 DELETE button
Time:13 Price:100 DELETE button
Time:15 Price:110 DELETE button
Time:17 Price:120 DELETE button
Time:18 Price:130 DELETE button
Time:19 Price:140 DELETE button

and so on.

When user clicks DELETE button, the row is removed and deleted from the
database.
What is the best way to do this?

Data grid or data repeater?

Any example? I don't know how to construct it. In asp it was easy with
response.write method and recordset

Thank you,
S

Nov 18 '05 #2
thank you.
do you have some example

Best regards,
Simon

"Raghavendra T V" <ra*****@hotmail.com> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
Hi Simon,

The Best way i would choose is to play around with the DataSet in which you have the Data
loop through the Dataset col / row collection in fashion that you want to
display. and build a new dataset and bind to Datagrid.

Thanks
Raghvendra

"simon" <si*********@stud-moderna.si> wrote in message
news:uA**************@TK2MSFTNGP10.phx.gbl...
I get from database something like this:

DAY HOUR PRICE
---------------------------------------------
MONDAY 10 100
MONDAY 11 120
MONDAY 12 130
MONDAY 13 140
MONDAY 14 150
TUESDAY 11 90
TUESDAY 13 100
TUESDAY 15 110
TUESDAY 17 120
TUESDAY 18 130
TUESDAY 19 140
....................

Now, I would like to show this on the page like this:

TIME AND PRICE FOR MONDAY
--------------------------------------------
Time:10 Price:100 DELETE button
Time:11 Price:120 DELETE button
Time:12 Price:130 DELETE button
Time:13 Price:140 DELETE button
Time:14 Price:150 DELETE button

TIME AND PRICE FOR TUESDAY
--------------------------------------------
Time:11 Price: 90 DELETE button
Time:13 Price:100 DELETE button
Time:15 Price:110 DELETE button
Time:17 Price:120 DELETE button
Time:18 Price:130 DELETE button
Time:19 Price:140 DELETE button

and so on.

When user clicks DELETE button, the row is removed and deleted from the
database.
What is the best way to do this?

Data grid or data repeater?

Any example? I don't know how to construct it. In asp it was easy with
response.write method and recordset

Thank you,
S


Nov 18 '05 #3
Simon,
You could do it that way... I found rather than abandon your ASP
experience, use the "Placeholder" control and just write the same
traditional HTML code in table format like you did in ASP...
You will likely need to use the Dataset Raghvendra suggests and you will
also want to add a Webform Button and have the clicks tracked on PostBack...

something like this (i hacked this from my code so code may not be
complete)...

Add Placeholder control to webform named "phGrid"

Private Sub LoadGrid(ByVal EID As Integer)
Dim strQuery As String
Dim oDA As SqlClient.SqlDataAdapter
Dim oDS As DataSet
Dim row As DataRow
Dim strOutput As New StringBuilder(1024)
Dim newLink As LinkButton
Try
oDS = New DataSet
strQuery = "Select * from Wherever Order By Whichever"
oDA = New SqlClient.SqlDataAdapter(strQuery,
MySvrConnectionString)
oDA.Fill(oDS, "MyData")
phGrid.Controls.Clear()
strOutput.Remove(0, strOutput.Length)
strOutput.Insert(0, "<table border=1 cellspacing=0 >")
phGrid.Controls.Add(New LiteralControl(strOutput.ToString)) '
output string to PHcontrol

For Each row In oDS.Tables("MyData").Rows
strOutput.Remove(0, strOutput.Length)
strOutput.Insert(0, " ")
strOutput.Append("<tr><td align=left>")
strOutput.Append(row("MyField1"))
strOutput.Append("</td><td align=center>")
phGrid.Controls.Add(New LiteralControl(strOutput.ToString))

newLink = New LinkButton
newLink.ID = "Delete" & row("MyUniqueRecordID")
newLink.Text = "Delete"
newLink.CommandArgument = row("MyField2")
AddHandler newLink.Click, AddressOf Delete_Click
phGrid.Controls.Add(newLink)

phGrid.Controls.Add(New LiteralControl("</td></tr>"))
Next
phGrid.Controls.Add(New LiteralControl("</table>"))

Catch ex As Exception
' output errors
Finally
If (Not oDA Is Nothing) Then
oDA.Dispose()
End If
If (Not oDS Is Nothing) Then
oDS.Dispose()
End If
End Try
End Sub

.... then be sure to create your "Delete_Click" sub to catch the postback and
delete the appropriate record from the table...

Hope this helps!
wardeaux

"Raghavendra T V" <ra*****@hotmail.com> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
Hi Simon,

The Best way i would choose is to play around with the DataSet in which you have the Data
loop through the Dataset col / row collection in fashion that you want to
display. and build a new dataset and bind to Datagrid.

Thanks
Raghvendra

"simon" <si*********@stud-moderna.si> wrote in message
news:uA**************@TK2MSFTNGP10.phx.gbl...
I get from database something like this:

DAY HOUR PRICE
---------------------------------------------
MONDAY 10 100
MONDAY 11 120
MONDAY 12 130
MONDAY 13 140
MONDAY 14 150
TUESDAY 11 90
TUESDAY 13 100
TUESDAY 15 110
TUESDAY 17 120
TUESDAY 18 130
TUESDAY 19 140
....................

Now, I would like to show this on the page like this:

TIME AND PRICE FOR MONDAY
--------------------------------------------
Time:10 Price:100 DELETE button
Time:11 Price:120 DELETE button
Time:12 Price:130 DELETE button
Time:13 Price:140 DELETE button
Time:14 Price:150 DELETE button

TIME AND PRICE FOR TUESDAY
--------------------------------------------
Time:11 Price: 90 DELETE button
Time:13 Price:100 DELETE button
Time:15 Price:110 DELETE button
Time:17 Price:120 DELETE button
Time:18 Price:130 DELETE button
Time:19 Price:140 DELETE button

and so on.

When user clicks DELETE button, the row is removed and deleted from the
database.
What is the best way to do this?

Data grid or data repeater?

Any example? I don't know how to construct it. In asp it was easy with
response.write method and recordset

Thank you,
S


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
1
by: Proteus | last post by:
Any help appreciated on a small perl project I need to write for educator/teaching purposes. I have not programmed perl for some time, need to get up to speed, maybe some kind souls hrere will help...
2
by: Raskolnikow | last post by:
Hi! I have a very simple problem with itoa() or the localtime(...). Sorry, if it is too simple, I don't have a proper example. Please have a look at the comments. struct tm *systime; time_t...
3
by: Peter | last post by:
Hello Thanks for reviewing my question. I would like to know how can I programmatically select a node Thanks in Advanc Peter
7
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
4
by: dba_222 | last post by:
Dear Experts, Ok, I hate to ask such a seemingly dumb question, but I've already spent far too much time on this. More that I would care to admit. In Sql server, how do I simply change a...
14
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
10
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.