Element Name

deemka

New member
Joined
Jan 21, 2003
Messages
2
Location
Phily
Hello,
I am trying to change my element name, but am Not sure how to do it.

I am selecting from an oracle database

<WebMethod()> Public Function LetterLookUp1(ByVal acct As String, ByVal NumOfDays As String) As DataSet
Dim lobjConn As New OracleConnection()
Dim lobjCmd As New OracleCommand()
Dim lobjDa As New OracleDataAdapter()
Dim lobjDs As New DataSet()

lobjConn.ConnectionString = "Data Source=instance;User ID=uid;Password=pswd"
lobjConn.Open()

lobjCmd.Connection = lobjConn
lobjCmd.CommandType = CommandType.Text

lobjCmd.CommandText =
"SELECT CARDHOLDER_ACCT_NUM AS ACCT," & _
"LETTER_NUMBER AS LNUMBER," & _
"to_char(LETTER_DATE,mm/dd/yyyy) AS LDATE," & _
"POST_REASON AS LREASON " & _
"FROM cd159 " & _
"WHERE CardHolder_Acct_Num =" + acct + " AND Letter_Date >= (SYSDATE -" + NumOfDays + ")"

lobjDa.SelectCommand = lobjCmd
lobjDa.Fill(lobjDs)
lobjConn.Close()
LetterLookUp1 = lobjDs

What I get back is.
-<?xml version="1.0" encoding="utf-8" ?>
- <DataSet xmlns="http://tempuri.org/">
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="Table">
- <xs:complexType>
- <xs:sequence>
<xs:element name="ACCT" type="xs:string" minOccurs="0" />
<xs:element name="LNUMBER" type="xs:string" minOccurs="0" />
<xs:element name="LDATE" type="xs:string" minOccurs="0" />
<xs:element name="LREASON" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <NewDataSet xmlns="">
+ <Table diffgr:id="Table1" msdata:rowOrder="0">
<ACCT>5477533825820007</ACCT>
<LNUMBER>0829</LNUMBER>
<LDATE>01/13/2003</LDATE>
<LREASON>NO SUCH LETTER ON FILE</LREASON>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>

Why do my column tags come out as column names but my element (table name remains "table" instead of the table Name and how can I change my <table></table> tag to a <table_name></table_name> tag

Thanks
 
In the DataAdapters Fill method you can specify a table name.

Also note, if you are filling more than one table, all tables will use the same name that you give plus a number. So if you specify "Customer" as the table name, youll get "Customer", "Customer1", "Customer2" etc. In that case youd have to manually rename each table (I may be off on the numbering there - cant remember exactly how it starts).

-Nerseus
 
Thank you very much, That did it.

I finnaly found some one who knows what they are talking about.

Thanks again
 
Back
Top