Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

In the DataAdapter's 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, you'll get "Customer", "Customer1", "Customer2" etc. In that case you'd have to manually rename each table (I may be off on the numbering there - can't remember exactly how it starts).

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...