Thursday, March 16, 2006

convert a dataview to a dataset dataview to datatable

public static DataTable DataViewAsDataTable( DataView dv)
{
DataTable dt = dv.Table.Clone();
foreach (DataRowView drv in dv)
dt.ImportRow(drv.Row);
return dt;
}


DataSet dsFiltered = new DataSet(); //create a new dataset
dsFiltered.Tables.Add(AppUtil.DataViewAsDataTable (dvResult) ); //fill the dataset with the sorted results

convert a dataview to a dataset dataview to datatable

public static DataTable DataViewAsDataTable( DataView dv)
{
DataTable dt = dv.Table.Clone();
foreach (DataRowView drv in dv)
dt.ImportRow(drv.Row);
return dt;
}

Wednesday, March 01, 2006

Comerce server 2002 pup packaging problem Error finding IIS object

If you have this problem with commerce server 2002 when creating a pup package with the site packager:

Error finding IIS object for site:Automation error
The system cannot find the path specified.
Error finding directory for site 0:There is no entry in IIS for this
application on this machine.

Try this:
  1. Go into the properties for the web site and go to the "Home Directory" tab and click "Remove" under application settings and click "Create." Make sure your app pool is correct.
  2. ALSO repeat the same for your virtual directory.
  3. Run this in this in the MSCS_Admin database
    SELECT s_PropertyName, s_value FROM ResourceProps WHERE s_PropertyName ='s_WebServerInstance'
  4. If the value of WebServerInstace has a trailing zero, remove the zero
  5. In commerce center manager go here: Server manager -> Commerce Sites -> Your Site -> Applications -> IIS Site Name and verify your host name and IIS application path are correct. This is probably correcy but check it anyways. Next, click the web servers tab, and make sure your IIS web site is correct and click Synchronize. The odds are your IIS web site was not correct.
  6. Run iisreset and package again.

The biggest problem I see people explainin wrong in newsgroups is you need to do step 1 and 2 both.