hi all
I need to implement xml file but whit specific head for example.
<controles>
<ncontrols> information of database </ncontrols>
...
<ncontrols> xinformation of database </ncontrols>
</controles>
I made this xml file whit one datareader this is code source in VS:
dim strxmlstring
dim strfieldname as string
dim strfieldvalue as string
dim myconnstring as
string="server=myserver;uid=sa;pwd=;database=mydatabase"
dim sqltext="select * from mytable"
dim dbread as sqldatareader
dim sqlconn as sqlconnection=new sqlconnection(myconnstring)
dim sqlcmd as sqlcommand= new sqlcommand(sqltext,sqlconn)
sqlcmd.activeconnection.open()
sqlcmd.execute(dbread)
strxmlstring= "<controls>"
if dbread.hasmorerows() then
dim intidnode as string
While dbread.read()
intIDNode = strxmlstring.tostring()
label1.text=intidnode.tostring() this is one test in Label, but
not show nothing
End WHILE
end if
I thins that is because the variable string no sopport this value
"<" and ">" , If you have other form for build
this xml file it will be well received.
Best regards, yackson
-----Original Message-----
From: Alex Lowe [mailto:alowe@s...]
Sent: Freitag, 1. Juni 2001 20:15
To: ASP+
Subject: [aspx] Re: Dynamically change properties for webcontrols
Mikael,
Yes, it is possible. What makes this difficult is that the BackColor
property of the datagrid expects a value of type System.Drawing.Color (as
opposed a value of type String which is what I think most people who are new
to the framework will try). Because of this, you can still use a string
value to represent the color you want but you will also have to pass the
string value into the FromName method of the System.Drawing.Color class. For
example (notice I set the BackColor property in the code as opposed to the
BackColor property in the datagrid declaration),
------------------- test.aspx -------------------------
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQL" %>
<script language="C#" runat="server">
String TableColor = "blue";
void Page_Load(Object Src, EventArgs e)
{
DataSet myDataSet = new DataSet();
String SelectCommand ="Select * from Products";
SQLConnection MyConnection = new SQLConnection("Data
Source=localhost; uid=sa; pwd=; Initial Catalog=northwind");
SQLDataSetCommand MyCommand = new SQLDataSetCommand(SelectCommand,
MyConnection);
MyCommand.FillDataSet(myDataSet, "Products");
DataView myDataView = myDataSet.Tables["Products"].DefaultView;
MyDataGrid.BackColor = System.Drawing.Color.FromName(TableColor);
MyDataGrid.DataSource = myDataView;
MyDataGrid.DataBind();
}
</script>
<ASP:DataGrid id="MyDataGrid" runat="server"
Width="100%"
BorderColor="black"
ShowFooter="false"
CellPadding="3"
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
/>
----------------- end of test.aspx ------------------------------
hth,
Alex
http://www.asp-grandrapids.net
webmaster@a...
---- Original Message -----
From: "Mikael Larsson" <mickeboy@h...>
To: "ASP+" <aspx@p...>
Sent: Friday, June 01, 2001 5:34 PM
Subject: [aspx] Dynamically change properties for webcontrols
> Hi...
>
>
> I have the following problem:
>
> I have a global variable
>
> String TableColor = "";
>
> and want to assign the value of TableColor to BackColor
>
> <ASP:DataGrid id="MyDataGrid" runat="server"
> Width="100%"
> BackColor="<%=TableColor%>
> BorderColor="black"
> ShowFooter="false"
> CellPadding="3"
> CellSpacing="0"
> Font-Name="Verdana"
> Font-Size="8pt"
> HeaderStyle-BackColor="#aaaadd"
> />
>
> But I canīt get it right. Is it possible? Can someone please help me?
>
> Best regards
>
> Mikael