Hi All,
Please help me.
I need to pass a DataSet in MySQL.
It is feasible in MSSQL since I already tried it.
I do it like this in MSSQL:
In my c# code:
DataSet ds = new DataSet("Uploads");
ds.Tables.Add(new DataTable("exclution"));
SqlCommand oCommand = new SqlCommand("spUpdateDatabase", oConnection);
oCommand.CommandType = CommandType.StoredProcedure;
oCommand.Parameters.AddWithValue("@LocalDatabase", ds.GetXml());
And my stored procedure would be like this:
DECLARE @index int
BEGIN TRANSACTION
EXEC sp_xml_preparedocument @index OUTPUT, @LocalDatabase
INSERT INTO exclution
SELECT @BranchCode
, ExclutionID
, InsuredID
, InsuredRelationship
, ExclutionDiagnoses
FROM OPENXML(@index, 'Uploads/exclution')
WITH ( ExclutionID int 'ExclutionID'
, InsuredID int 'InsuredID'
, InsuredRelationship varchar(45) 'InsuredRelationship'
, ExclutionDiagnoses varchar(100)'ExclutionDiagnoses')
EXEC sp_xml_removedocument @index
IF (@@ERROR <> 0)
BEGIN
ROLLBACK TRANSACTION
SELECT 1
END
ELSE
BEGIN
COMMIT TRANSACTION
SELECT 0
END
But I cant find a way to do it in MySQL.
Any help would be greatly appreciated.
Thanks in advance.