Hi Guys
i having the same problem with Strongly typed dataset, I have created
a stronsetly typed dataset by draging table from Server explorer and
now i have retreived xml from SQL server 2000 and tried to populate
dataset but it populates 0 rows even though ml contains rows. If i use
regular Dataset instead of Typed dataset, then everything works just
fine..please help me as soon as possible, here is my code snippet.
I think you have solution to this prolem and could you please code
snippet to solve this problem.
using Microsoft.Data.SqlXml;
private void button3_Click(object sender, System.EventArgs e)
{
String connectionString =
"Provider=SQLOLEDB;Server=local);database=Opus;use r id=sa";
SqlXmlCommand command = new SqlXmlCommand(connectionString);
command.CommandText = "SELECT * FROM Contracts FOR XML
AUTO,XMLDATA";
command.RootTag = "root";
//dsContract is typed dataset created by dropping table for server
explorer
dsContract datasetContract = new dsContract();
SqlXmlAdapter adp = new SqlXmlAdapter(command);
adp.Fill(datasetContract);
dataGrid1.DataSource = datasetContract;
}
but above code does not fill dsContract dataset even though sqlCommand
does retrive rows.
I am seeking help desparately.
Waiting for positive reply.
Many thanks in advance.
Linesh