calling OracleDataSetGenerator question

calling OracleDataSetGenerator question

Postby Tatyana » Thu 06 Nov 2008 11:48

I want is generate *.Designer.cs file for xsd-file of the typed dataset.

I want to do it in the run time or from the command line. NOT by "Run Custom Tool".

Do you have some kind of tool like standard .NET xsd.exe file.

Or will you please help me with generating from the code. I tried this:

class DummyProgress : CoreLab.Common.Design.IVsGeneratorProgress {
public void GeneratorError(bool isWarning, int dwLevel, string
bstrError, int dwLine, int dwColumn) {
}
public void Progress(int nComplete, int nTotal) {
}
}


private void GenerateOracleCodeFile(string inputFileName) {

CoreLab.Oracle.Design.OracleDataSetGenerator gen = new
CoreLab.Oracle.Design.OracleDataSetGenerator();
string rdr = File.ReadAllText(inputFileName);
IntPtr rgbOutputFileContents;
int pcbOutput = -1;
CoreLab.Common.Design.IVsGeneratorProgress
pGenerateProgress;
gen.Generate(inputFileName, rdr, "MyNamespace", out
rgbOutputFileContents, out pcbOutput, progress);
}

I get an error "Get CodeDomProvider Interface failed.". I tried different ways to set CodeDomProvider, but unfortunately I haven't succeeded.

Will you please help me...
________
Mercedes wiki
Last edited by Tatyana on Thu 24 Feb 2011 22:45, edited 1 time in total.
Tatyana
 
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Postby Tatyana » Thu 06 Nov 2008 14:26

OracleDataSetGenerator has public method SetSite(object pUnkSite).
Will you please tell me how should it be used? What should I pass to it?
Please help me. I'm tring to figure it out....
________
Rehab community
Last edited by Tatyana on Mon 07 Mar 2011 04:18, edited 1 time in total.
Tatyana
 
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Postby Tatyana » Fri 07 Nov 2008 18:24

PropertyInfo pi = gen.GetType().GetProperty("CodeProvider", BindingFlags.Instance | BindingFlags.NonPublic);
CSharpCodeProvider prov = new CSharpCodeProvider();
pi.SetValue(gen, prov, null);

gen.Generate(inputFileName, rdr, "MyNamespace", out rgbOutputFileContents, out pcbOutput, progress);
string Code = Marshal.PtrToStringAnsi(rgbOutputFileContents);

:twisted:
________
VAPORIZER REVIEW
Tatyana
 
Posts: 17
Joined: Mon 08 Sep 2008 14:01


Return to dotConnect for Oracle