proble for Inserting values in XML from database

Posted by Shoyebaziz123 under ASP.NET on 10/13/2009 | Views : 3170 | Status : [Member] | Replies : 5
Hi All,
I have a xml File named ITR_1.xml

<?xml version="1.0" encoding="UTF-8"?>
<ITR xmlns="http://incometaxindiaefiling.gov.in/main" xmlns:n1="http://incometaxindiaefiling.gov.in/" xmlns:ITR1FORM="http://incometaxindiaefiling.gov.in/ITR1" xmlns:ITR2FORM="http://incometaxindiaefiling.gov.in/ITR2" xmlns:ITR3FORM="http://incometaxindiaefiling.gov.in/ITR3" xmlns:ITR4FORM="http://incometaxindiaefiling.gov.in/ITR4" xmlns:ITRForm="http://incometaxindiaefiling.gov.in/master" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://incometaxindiaefiling.gov.in/main ITRMain09.xsd">
<ITR1FORM:ITR1>
<ITRForm:CreationInfo>
<ITRForm:SWVersionNo>4923</ITRForm:SWVersionNo>
<ITRForm:SWCreatedBy>KDK</ITRForm:SWCreatedBy>
<ITRForm:XMLCreatedBy>ZenIT</ITRForm:XMLCreatedBy>
<ITRForm:XMLCreationDate>2009-10-12</ITRForm:XMLCreationDate>
<ITRForm:IntermediaryCity>Jaipur</ITRForm:IntermediaryCity>
</ITRForm:CreationInfo>
<ITRForm:Form_ITR1>
<ITRForm:FormName>ITR-1</ITRForm:FormName>
<ITRForm:Description>For Indls having Income from Salary, Pension, family pension and Interest</ITRForm:Description>
<ITRForm:AssessmentYear>2009</ITRForm:AssessmentYear>
<ITRForm:SchemaVer>Ver1.0</ITRForm:SchemaVer>
<ITRForm:FormVer>Ver1.0</ITRForm:FormVer>
</ITRForm:Form_ITR1>
<ITRForm:PersonalInfo>
<ITRForm:AssesseeName>
<ITRForm:FirstName>PRAMOD</ITRForm:FirstName>
<ITRForm:MiddleName>PILLAY</ITRForm:MiddleName>
<ITRForm:SurNameOrOrgName>RAGHVAN</ITRForm:SurNameOrOrgName>
.
.
.
.


<ITRForm:Place>NAGPUR</ITRForm:Place>
<ITRForm:Date>2009-09-30</ITRForm:Date>
</ITRForm:Verification>
</ITR1FORM:ITR1>
</ITR>


then i have written this type of code to fill xml


Public Sub Fill_Section(ByVal clid As Integer, ByVal finyr As String)
Try
Class1.con.Close()
Class1.con.Open()
da = New SqlDataAdapter(" SELECT ClientMaster.ClientId, ClientMaster.FirstName, ClientMaster.MiddleName, ClientMaster.SurName, ClientMaster.PANNo, ClientMaster.ResiFlatNo, "
" ClientMaster.ResiBuildingName, CONVERT(char(20), ClientMaster.DOB, 103) AS DOB, ClientMaster.ResiStreet, ClientMaster.ResiArea, " & _
" FROM ClientMaster INNER JOIN IncomeTaxMaster ON ClientMaster.ClientId = IncomeTaxMaster.ClientId INNER JOIN " & _
" ClientITRMaster ON ClientMaster.ClientId = ClientITRMaster.ClientId INNER JOIN MasterResiStatus ON ClientMaster.ResiStatusId = MasterResiStatus.StatusId LEFT OUTER JOIN " & _
" MasterState ON ClientMaster.StateId = MasterState.StateId LEFT OUTER JOIN MasterWardCircle ON ClientMaster.WardCircleId = MasterWardCircle.WardCircleId " & _
" WHERE ClientMaster.ClientId=" & clid & " ", Class1.con)
da.Fill(ds1, "NAME")
ds.ReadXml(Request.PhysicalApplicationPath + "ITR_1.xml")
Dim row As DataRow = ds.Tables(0).NewRow
row("ITRForm:FirstName") = ds1.Tables(0).Rows(0).Item(1)
row("ITRForm:MiddleName") = ds1.Tables(0).Rows(0).Item(2)
Catch ex As Exception
Response.Write(ex.Message)
End Try

End Sub

while i m running this code the exeption occure that " Column 'ITRForm:FirstName' does not belong to table ITR1. "
also if i check ds it fill up with
ITR1_Id TaxExmpIntInc
0 0





Responses

Posted by: Vuyiswamb on: 10/13/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
what is the Problem ?

Thank you for posting at Dotnetfunda
[Administrator]

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Poster on: 10/14/2009 [Member] Starter

Up
0
Down
He has already written the problem "while i m running this code the exeption occure that " Column 'ITRForm:FirstName' does not belong to table ITR1. "
also if i check ds it fill up with
ITR1_Id TaxExmpIntInc "

What more are you expecting ?

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Goldytech on: 10/14/2009 [Member] Bronze

Up
0
Down
Can you execute the above query in SQL Management Studio Query and check whether it is gettting executed or giving you the same error. If it gives the same error then please recheck your query syntax and joins.

Hope this helps.

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 10/14/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
The Problem is here

row("ITRForm:FirstName") = ds1.Tables(0).Rows(0).Item(1)
row("ITRForm:MiddleName") = ds1.Tables(0).Rows(0).Item(2)


try to execute it like this
[code]
row("FirstName") = ds1.Tables(0).Rows(0).Item(1)
row("MiddleName") = ds1.Tables(0).Rows(0).Item(2)

Thank you for posting at Dotnetfunda
[Administrator]

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santosh4u on: 10/16/2009 [Member] Bronze

Up
0
Down
Plz tell the Exact Error?

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response