473,395 Members | 1,418 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,395 software developers and data experts.

How to convert this ?

Oopps sorry for the previous post.
As I said, I m trying to make a web custom control and I do know how I have
to convert
this part to for the render section

In fact it may be a stupid question, how to "ouput" this section
Table1 = CType(S_TABLES(S_IdAnnee), System.Web.UI.WebControls.Table)
Table1.Visible = True

Stan

Here's the code

Private Sub ThingToDisplay
Dim I As Integer
Dim Paragraphe As String
Dim Row, Row1 As DataRow
Dim Tableau As New System.Web.UI.WebControls.Table
Dim Ligne As New System.Web.UI.WebControls.TableRow
Dim cell1 As New System.Web.UI.WebControls.TableCell
Dim cell2 As New System.Web.UI.WebControls.TableCell
Dim cell3 As New System.Web.UI.WebControls.TableCell
S_DataSet.Tables.Add("QUESTIONS")
daQUESTIONS.SelectCommand = SQL_LISTE_QUESTIONS(S_Langue, S_IdPays,
S_IdChapitre, S_IdSchapitre)
daQUESTIONS.Fill(S_DataSet.Tables("QUESTIONS"))
With S_DataSet.Tables.Add("REPONSES_SPE")
.Columns.Add("idquestion", GetType(Integer))
For I = 1993 To 2008
.Columns.Add("V" & I.ToString, GetType(String))
Next
.PrimaryKey = New DataColumn() {.Columns("idquestion")}
End With

daREPONSES_SPE.SelectCommand = SQL_LISTE_REPONSES_SPE(S_IdPays,
S_IdChapitre, S_IdSchapitre)
daREPONSES_SPE.Fill(S_DataSet.Tables("REPONSES_SPE "))
With S_DataSet.Tables.Add("REPONSES")
.Columns.Add("idquestion", GetType(Integer))
For I = 1993 To 2008
.Columns.Add("A" & I.ToString, GetType(Decimal))
.Columns.Add("S" & I.ToString, GetType(String))
Next
.PrimaryKey = New DataColumn() {.Columns("idquestion")}
End With
daREPONSES.SelectCommand = SQL_LISTE_REPONSES(S_IdPays, S_IdChapitre,
S_IdSchapitre)
daREPONSES.Fill(S_DataSet.Tables("REPONSES"))
Dim CPTAN As Integer = 3
For I = 1993 To 2008
CPTAN += 1
Tableau = New System.Web.UI.WebControls.Table
Tableau.ID = "Q" + I.ToString
Tableau.CssClass = CssTableau
Tableau.Width = System.Web.UI.WebControls.Unit.Point(LargeurColonn e1 +
LargeurColonne2 + LargeurColonne3)
Tableau.Visible = False
Ligne = New System.Web.UI.WebControls.TableRow
cell1 = New System.Web.UI.WebControls.TableCell
cell2 = New System.Web.UI.WebControls.TableCell
cell3 = New System.Web.UI.WebControls.TableCell
cell2.CssClass = CssValeur
cell2.Text = "<b>Valeur</b>"
cell3.CssClass = CssSource
cell3.Text = "<b>Source</b>"
Ligne.Cells.Add(cell1)
Ligne.Cells.Add(cell2)
Ligne.Cells.Add(cell3)
Tableau.Rows.Add(Ligne)
For Each Row In S_DataSet.Tables("QUESTIONS").Rows
If Paragraphe <> Row("paragraphe") Then
Ligne = New System.Web.UI.WebControls.TableRow
cell1 = New System.Web.UI.WebControls.TableCell
cell1.ColumnSpan = 3
cell1.CssClass = CssParagraphe
cell1.Text = "<b>" & Row("Paragraphe") & "</b>"
Paragraphe = Row("paragraphe")
Ligne.Cells.Add(cell1)
Tableau.Rows.Add(Ligne)
End If
Ligne = New System.Web.UI.WebControls.TableRow
cell1 = New System.Web.UI.WebControls.TableCell
cell2 = New System.Web.UI.WebControls.TableCell
cell3 = New System.Web.UI.WebControls.TableCell
cell1.CssClass = CssBox
cell2.CssClass = CssBox
cell3.CssClass = CssBox
If Row("Question") = "[TEXT]" Then
Saisie = New System.Web.UI.WebControls.TextBox
Saisie.Attributes.Add("onChange", "changement=1;")
Saisie.Width = System.Web.UI.WebControls.Unit.Point(LargeurBoxSpe cial)
Saisie.CssClass = CssBoxSpecial
Saisie.ID = "T_" & Row("idquestion").ToString & "_" & I.ToString
Row1 = S_DataSet.Tables("REPONSES_SPE").Rows.Find(Row("id question"))
If Not Row1 Is Nothing Then
Saisie.Text = Row1(CPTAN - 3)
End If
cell1.Controls.Add(Saisie)
Else
cell1.Text = Row("QUESTION")
End If
Saisie = New System.Web.UI.WebControls.TextBox
Saisie.Width = System.Web.UI.WebControls.Unit.Point(LargeurBoxVal eur)
Saisie.CssClass = CssBoxValeur
Saisie.ID = Row("idquestion").ToString & "_" & I.ToString
If Val(Row(CPTAN)) > -1 Then
Saisie.Text = Row(CPTAN)
End If
Saisie.Attributes.Add("onChange", "changement=1;")
Saisie.Attributes("onblur") = "TypeChamps(this,'" & Trim(Row("TypeTest"))
& "');"
cell2.Controls.Add(Saisie)
Saisie = New System.Web.UI.WebControls.TextBox
Saisie.Attributes.Add("onChange", "changement=1;")
Saisie.CssClass = CssBoxSource
Saisie.Width = System.Web.UI.WebControls.Unit.Point(LargeurBoxSou rce)
Saisie.ID = "S" & Row("idquestion").ToString & "_" & I.ToString
Saisie.Text = Row(17 + CPTAN)
cell3.Controls.Add(Saisie)
cell1.CssClass = "texte"
cell2.CssClass = "texte"
cell3.CssClass = "texte"
cell1.Width = System.Web.UI.WebControls.Unit.Point(LargeurColonn e1)
cell2.Width = System.Web.UI.WebControls.Unit.Point(LargeurColonn e2)
cell3.Width = System.Web.UI.WebControls.Unit.Point(LargeurColonn e3)
Ligne.Cells.Add(cell1)
Ligne.Cells.Add(cell2)
Ligne.Cells.Add(cell3)
Tableau.Rows.Add(Ligne)
Next
S_TABLES.Add(I, Tableau)
Next
Dim Table1 As System.Web.UI.WebControls.Table
Table1 = CType(S_TABLES(S_IdAnnee), System.Web.UI.WebControls.Table)
Table1.Visible = True
End Sub

Nov 18 '05 #1
1 3596
Ok, I think I ve found my solution
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Table1.RenderControl(hw)
Charge = tw.ToString()
Stan

"Stan Sainte-Rose" <st**@cyber972.com> a écrit dans le message de news:
Oq**************@tk2msftngp13.phx.gbl...
Oopps sorry for the previous post.
As I said, I m trying to make a web custom control and I do know how I have to convert
this part to for the render section

In fact it may be a stupid question, how to "ouput" this section
Table1 = CType(S_TABLES(S_IdAnnee), System.Web.UI.WebControls.Table)
Table1.Visible = True

Stan

Here's the code

Private Sub ThingToDisplay
Dim I As Integer
Dim Paragraphe As String
Dim Row, Row1 As DataRow
Dim Tableau As New System.Web.UI.WebControls.Table
Dim Ligne As New System.Web.UI.WebControls.TableRow
Dim cell1 As New System.Web.UI.WebControls.TableCell
Dim cell2 As New System.Web.UI.WebControls.TableCell
Dim cell3 As New System.Web.UI.WebControls.TableCell
S_DataSet.Tables.Add("QUESTIONS")
daQUESTIONS.SelectCommand = SQL_LISTE_QUESTIONS(S_Langue, S_IdPays,
S_IdChapitre, S_IdSchapitre)
daQUESTIONS.Fill(S_DataSet.Tables("QUESTIONS"))
With S_DataSet.Tables.Add("REPONSES_SPE")
.Columns.Add("idquestion", GetType(Integer))
For I = 1993 To 2008
.Columns.Add("V" & I.ToString, GetType(String))
Next
.PrimaryKey = New DataColumn() {.Columns("idquestion")}
End With

daREPONSES_SPE.SelectCommand = SQL_LISTE_REPONSES_SPE(S_IdPays,
S_IdChapitre, S_IdSchapitre)
daREPONSES_SPE.Fill(S_DataSet.Tables("REPONSES_SPE "))
With S_DataSet.Tables.Add("REPONSES")
.Columns.Add("idquestion", GetType(Integer))
For I = 1993 To 2008
.Columns.Add("A" & I.ToString, GetType(Decimal))
.Columns.Add("S" & I.ToString, GetType(String))
Next
.PrimaryKey = New DataColumn() {.Columns("idquestion")}
End With
daREPONSES.SelectCommand = SQL_LISTE_REPONSES(S_IdPays, S_IdChapitre,
S_IdSchapitre)
daREPONSES.Fill(S_DataSet.Tables("REPONSES"))
Dim CPTAN As Integer = 3
For I = 1993 To 2008
CPTAN += 1
Tableau = New System.Web.UI.WebControls.Table
Tableau.ID = "Q" + I.ToString
Tableau.CssClass = CssTableau
Tableau.Width = System.Web.UI.WebControls.Unit.Point(LargeurColonn e1 +
LargeurColonne2 + LargeurColonne3)
Tableau.Visible = False
Ligne = New System.Web.UI.WebControls.TableRow
cell1 = New System.Web.UI.WebControls.TableCell
cell2 = New System.Web.UI.WebControls.TableCell
cell3 = New System.Web.UI.WebControls.TableCell
cell2.CssClass = CssValeur
cell2.Text = "<b>Valeur</b>"
cell3.CssClass = CssSource
cell3.Text = "<b>Source</b>"
Ligne.Cells.Add(cell1)
Ligne.Cells.Add(cell2)
Ligne.Cells.Add(cell3)
Tableau.Rows.Add(Ligne)
For Each Row In S_DataSet.Tables("QUESTIONS").Rows
If Paragraphe <> Row("paragraphe") Then
Ligne = New System.Web.UI.WebControls.TableRow
cell1 = New System.Web.UI.WebControls.TableCell
cell1.ColumnSpan = 3
cell1.CssClass = CssParagraphe
cell1.Text = "<b>" & Row("Paragraphe") & "</b>"
Paragraphe = Row("paragraphe")
Ligne.Cells.Add(cell1)
Tableau.Rows.Add(Ligne)
End If
Ligne = New System.Web.UI.WebControls.TableRow
cell1 = New System.Web.UI.WebControls.TableCell
cell2 = New System.Web.UI.WebControls.TableCell
cell3 = New System.Web.UI.WebControls.TableCell
cell1.CssClass = CssBox
cell2.CssClass = CssBox
cell3.CssClass = CssBox
If Row("Question") = "[TEXT]" Then
Saisie = New System.Web.UI.WebControls.TextBox
Saisie.Attributes.Add("onChange", "changement=1;")
Saisie.Width = System.Web.UI.WebControls.Unit.Point(LargeurBoxSpe cial)
Saisie.CssClass = CssBoxSpecial
Saisie.ID = "T_" & Row("idquestion").ToString & "_" & I.ToString
Row1 = S_DataSet.Tables("REPONSES_SPE").Rows.Find(Row("id question"))
If Not Row1 Is Nothing Then
Saisie.Text = Row1(CPTAN - 3)
End If
cell1.Controls.Add(Saisie)
Else
cell1.Text = Row("QUESTION")
End If
Saisie = New System.Web.UI.WebControls.TextBox
Saisie.Width = System.Web.UI.WebControls.Unit.Point(LargeurBoxVal eur)
Saisie.CssClass = CssBoxValeur
Saisie.ID = Row("idquestion").ToString & "_" & I.ToString
If Val(Row(CPTAN)) > -1 Then
Saisie.Text = Row(CPTAN)
End If
Saisie.Attributes.Add("onChange", "changement=1;")
Saisie.Attributes("onblur") = "TypeChamps(this,'" & Trim(Row("TypeTest")) & "');"
cell2.Controls.Add(Saisie)
Saisie = New System.Web.UI.WebControls.TextBox
Saisie.Attributes.Add("onChange", "changement=1;")
Saisie.CssClass = CssBoxSource
Saisie.Width = System.Web.UI.WebControls.Unit.Point(LargeurBoxSou rce)
Saisie.ID = "S" & Row("idquestion").ToString & "_" & I.ToString
Saisie.Text = Row(17 + CPTAN)
cell3.Controls.Add(Saisie)
cell1.CssClass = "texte"
cell2.CssClass = "texte"
cell3.CssClass = "texte"
cell1.Width = System.Web.UI.WebControls.Unit.Point(LargeurColonn e1)
cell2.Width = System.Web.UI.WebControls.Unit.Point(LargeurColonn e2)
cell3.Width = System.Web.UI.WebControls.Unit.Point(LargeurColonn e3)
Ligne.Cells.Add(cell1)
Ligne.Cells.Add(cell2)
Ligne.Cells.Add(cell3)
Tableau.Rows.Add(Ligne)
Next
S_TABLES.Add(I, Tableau)
Next
Dim Table1 As System.Web.UI.WebControls.Table
Table1 = CType(S_TABLES(S_IdAnnee), System.Web.UI.WebControls.Table)
Table1.Visible = True
End Sub

Nov 18 '05 #2

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

Similar topics

19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
1
by: Logan X via .NET 247 | last post by:
It's official....Convert blows. I ran a number of tests converting a double to an integer usingboth Convert & CType. I *ASSUMED* that CType would piggy-back ontop of Convert, and that performance...
4
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
3
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
7
by: patang | last post by:
I want to convert amount to words. Is there any funciton available? Example: $230.30 Two Hundred Thirty Dollars and 30/100
4
by: Edwin Knoppert | last post by:
In my code i use the text from a textbox and convert it to a double value. I was using Convert.ToDouble() but i'm used to convert comma to dot. This way i can assure the text is correct. However...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
6
by: Ken Fine | last post by:
This is a basic question. What is the difference between casting and using the Convert.ToXXX methods, from the standpoint of the compiler, in terms of performance, and in other ways? e.g. ...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.