Category: Misc

The specified module could not be found

If the new system is a 64-bit OS system, then during compilation “target platform” should be set to 64-bit (and not “Any Platform”).
more info here:
http://blogs.msdn.com/delay/archive/2006/03/23/559142.aspx

If the system is OK (32bit OS) then the following steps should help:

To find exact errors the following tools should be used.
1. Assembly Binding Log Viewer (Fuslogvw.exe). (part of SDK Tool v2.0) (http://msdn2.microsoft.com/en-us/library/e74a18c4(VS.80).aspx)
Just run the viewer, enable the “Log bind failures to disk” setting, run the tool again, then refresh the viewer and open the failed binding entry (open all entries one by one until you see failing entry)

2. Filemon for windows (http://www.microsoft.com/technet/sysinternals/utilities/Filemon.mspx)
Run Filemon, specify a filter of “*tool_name*” to limit the output, then run the program of interest. Filemon will capture a whole bunch of stuff, so save the output to a file where it can be searched more easily.

Ex:
In my case the problem was that PDFLIB was using 2 libraries:
– pdflib_dotnet.dll
– msvcr71.dll

In manual for using PDFLIB with ASP.NET it states that:
“Both pdflib_dotnet.dll and msvcr71.dll should be placed in bin folder”

ASP.NET compiler was looking for msvcr71.dll within the folder C:/windows/system32 (and many other folders).
Without going too deep in the details, i just copied one copy of msvcr71.dll from the bin folder to the system32.
Voila, everything started working.

Apparently system was set up some weird way and ASP.NET compiler was looking for msvcr71.dll in system32. Because the website works even without “msvcr71.dll” placed in a bin folder.

How to install PHP on Windows

Installing PHP >= 4.3.1 & 4.1 on Windows 2000 IIS Server

Windows PHP Installation (from the WebSite)

1)       Download the full PHP windows binaries from http://www.php.net. Do NOT use the small installer. Extract the ZIP to c:\php\.
2)       Copy the php.ini-recommended to c:\winnt\php.ini.
3)       Copy php.exe, php4ts.dll, & php4ts.lib to c:\winnt\system32.
4)       Copy the entire contents of c:\php\dlls to c:\winnt\system32.
5)       In IIS, add PHP as an application mapping .php to “c:\php\php.exe %s %s” (minus the quotes, and note the double %s).
6)       Be sure your IIS user (I_USR_xxxxx) has read and execute privileges on c:\php\ and all subfolders.
7)       Edit your c:\winnt\php.ini and be sure the following line is in it.

cgi.force_redirect = 0

MY OWN METHOD:

1. Download binary… the bigger file
2. copy paste php.ini to C:/windows
– must change : extension_dir = “C:\php\extensions\”
– might change: include_path = “.;c:\php\includes”
– might change: extension=php_curl.dll (remove ; in front of line)
3. copy php4ts.lib, php4ts.dll, php.exe to windows\system32
4. copy all files withing dlls into windows\system32
5. make sure php directory has access to “I_USR xxx” enabled
6. in IIS, computer name->properties->Internet Information Services-> WWWService-> Edit
– home page-> settings->add .php (c:\php\isapi\php4isapi.dll)
– Isapi FIlters-> add-> PHP (c:\php\isapi\php4isapi.dll)
7. might do : make necessary directory Public Website..

8. test… <? phpinfo();?>

also check this:

How To Install PHP on IIS 6.0

http://www.webpronews.com/expertarticles/2006/06/19/installing-php-on-iis-windows-xp-pro
http://www.php.net/install.windows

Installing PHP >= 4.3.1 & 4.1 on Windows 2000 IIS Server

 

Windows PHP Installation (from the WebSite)

 

1)       Download the full PHP windows binaries from http://www.php.net. Do NOT use the small installer. Extract the ZIP to c:\php\.

2)       Copy the php.ini-recommended to c:\winnt\php.ini.

3)       Copy php.exe, php4ts.dll, & php4ts.lib to c:\winnt\system32.

4)       Copy the entire contents of c:\php\dlls to c:\winnt\system32.

5)       In IIS, add PHP as an application mapping .php to “c:\php\php.exe %s %s” (minus the quotes, and note the double %s).

6)       Be sure your IIS user (I_USR_xxxxx) has read and execute privileges on c:\php\ and all subfolders.

7)       Edit your c:\winnt\php.ini and be sure the following line is in it.

 

cgi.force_redirect = 0

 

MY OWN METHOD:

 

1. Download binary… the bigger file

2. copy paste php.ini to C:/windows

– must change : extension_dir = “C:\php\extensions\”

– might change: include_path = “.;c:\php\includes”

– might change: extension=php_curl.dll (remove ; in front of line)

3. copy php4ts.lib, php4ts.dll, php.exe to windows\system32

4. copy all files withing dlls into windows\system32

5. make sure php directory has access to “I_USR xxx” enabled

6. in IIS, computer name->properties->Internet Information Services-> WWWService-> Edit

– home page-> settings->add .php (c:\php\isapi\php4isapi.dll)

– Isapi FIlters-> add-> PHP (c:\php\isapi\php4isapi.dll)

7. might do : make necessary directory Public Website..

 

8. test… <? phpinfo();?>

 

also check this:

http://www.iisadmin.co.uk/?p=4

http://www.webpronews.com/expertarticles/2006/06/19/installing-php-on-iis-windows-xp-pro

http://www.php.net/install.windows

 

PDFLib – Macro has odd number of elements

macro = { H1 {fontname=Helvetica-Condensed fontsize=5 leading=7 alignment=left horizscaling=100 encoding=winansi embedding=true
fillcolor={ spotname {PANTONE 423 CVU} 1 }}” & _
“H2 {fontname=Helvetica-Condensed fontsize=5 leading=7 alignment=left
horizscaling=100 encoding=winansi embedding=true
fillcolor={cmyk 1 1 1 1}}” & _
“H3 {fontname=Bembo fontsize=6 leading=8 alignment=left horizscaling=100
encoding=winansi embedding=true fillcolor={cmyk 1 1 1 1}}” & _
“H4 {fontname=Bembo fontsize=5 leading=7 alignment=left horizscaling=100
encoding=winansi embedding=true fillcolor={ spotname {PANTONE 423 CVU} 1 }} }”

should be converted to

macro = { H1 {fontname=Helvetica-Condensed fontsize=5 leading=7 alignment=left horizscaling=100 encoding=winansi embedding=true
fillcolor={ spotname {PANTONE 423 CVU} 1 }}” & _
” H2 {fontname=Helvetica-Condensed fontsize=5 leading=7 alignment=left
horizscaling=100 encoding=winansi embedding=true
fillcolor={cmyk 1 1 1 1}}” & _
” H3 {fontname=Bembo fontsize=6 leading=8 alignment=left horizscaling=100
encoding=winansi embedding=true fillcolor={cmyk 1 1 1 1}}” & _
” H4 {fontname=Bembo fontsize=5 leading=7 alignment=left horizscaling=100
encoding=winansi embedding=true fillcolor={ spotname {PANTONE 423 CVU} 1 }} }”

notice space between H and “

How to work with DataView construct

Represents a VIEW of the table.
Columns cannot be deleted.

To delete column, delete column from the DataTable from which DataView is originated.
Then create DataView again.

Ex:

SqlConnection conn = new SqlConnection(strConn);
DataSet ds_orig = new DataSet();
DataSet ds_copy = new DataSet();
DataTable dt;
DataView dv;

SqlDataAdapter da = new SqlDataAdapter("SELECT Title,FirstName,LastName FROM
Employees",conn);
da.Fill(ds_orig);
ds_copy = ds_orig.Copy();
dt = ds_copy.Tables[0];
dt.Columns.Remove("Title");
dv = new DataView(dt);

dataGrid1.DataSource = ds_orig;
dataGrid2.DataSource = dv;

The best data structures to manipulate data manually = DataTable + DataRow + DataView

Here is a simple class that populates GridView control.
This is the best method for doing MANUAL data manipulations.
Code is in C# and VB.NET formats

C#
<%@ Import Namespace="System.Data" %>
<html>
<script language="C#" runat="server">

 string SortField;

 ICollection CreateDataSource() {
 DataTable dt = new DataTable();
 DataRow dr;

 dt.Columns.Add(new DataColumn("IntegerValue", typeof(Int32)));
 dt.Columns.Add(new DataColumn("StringValue", typeof(string)));
 dt.Columns.Add(new DataColumn("DateTimeValue", typeof(DateTime)));
 dt.Columns.Add(new DataColumn("BoolValue", typeof(bool)));
 dt.Columns.Add(new DataColumn("CurrencyValue", typeof(double)));

 for (int i = 0; i < 9; i++) {
 dr = dt.NewRow();

 dr[0] = 9-i;
 dr[1] = "Item " + i.ToString();
 dr[2] = DateTime.Now;
 dr[3] = (i % 2 != 0) ? true : false;
 dr[4] = 1.23 * (i+1);

 dt.Rows.Add(dr);
 }

 DataView dv = new DataView(dt);
 dv.Sort = SortField;
 return dv;
 }

 void Page_Load(Object sender, EventArgs e) {
 if (!IsPostBack) {
 if (SortField == "") {
 SortField = "IntegerValue";
 }    
 BindGrid();
 }    
 }

 void MyDataGrid_Sort(Object sender, DataGridSortCommandEventArgs e) {
 SortField = (string)e.SortExpression;
 BindGrid();
 }

 void BindGrid() {
 MyDataGrid.DataSource = CreateDataSource();
 MyDataGrid.DataBind();
 }

</script>

<body>

 <h3><font face="Verdana">Basic Sorting in DataGrid</font></h3>

 <form runat=server>

 <ASP:DataGrid id="MyDataGrid" runat="server"
 AllowSorting="true"
 OnSortCommand="MyDataGrid_Sort"
 BorderColor="black"
 BorderWidth="1"
 CellPadding="3"
 Font-Name="Verdana"
 Font-Size="8pt"
 HeaderStyle-BackColor="#ccccff"
 HeaderStyle-ForeColor="black"
 />

</form>

</body>
</html>

VB.NET
<%@ Import Namespace="System.Data" %>

<html>
<script language="VB" runat="server">

 Dim SortField As String

 Function CreateDataSource() As ICollection

 Dim dt As DataTable
 Dim dr As DataRow
 Dim i As Integer

 'create a DataTable
 dt = New DataTable
 dt.Columns.Add(New DataColumn("IntegerValue", GetType(Integer)))
 dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
 dt.Columns.Add(New DataColumn("DateTimeValue", GetType(DateTime)))
 dt.Columns.Add(New DataColumn("BoolValue", GetType(Boolean)))
 dt.Columns.Add(new DataColumn("CurrencyValue", GetType(Double)))

 'Make some rows and put some sample data in
 For i = 1 To 9
 dr = dt.NewRow()
 dr(0) = 9-i
 dr(1) = "Item " & i.ToString()
 dr(2) = DateTime.Now.ToShortTimeString
 If (i Mod 2 <> 0) Then
 dr(3) = True
 Else
 dr(3) = False
 End If
 dr(4) = 1.23 * (i + 1)
 'add the row to the datatable
 dt.Rows.Add(dr)
 Next

 'return a DataView to the DataTable
 Dim dv as DataView = New DataView(dt)
 dv.Sort = SortField
 CreateDataSource = dv
 End Function        

 Sub Page_Load(sender As Object, e As EventArgs)
 If Not IsPostBack Then
 If SortField = "" Then
 SortField = "IntegerValue"
 End If   
 BindGrid
 End If
 End Sub

 Sub MyDataGrid_Sort(sender As Object, e As DataGridSortCommandEventArgs)
 SortField = e.SortExpression
 BindGrid
 End Sub

 Sub BindGrid()
 MyDataGrid.DataSource = CreateDataSource()
 MyDataGrid.DataBind
 End Sub

</script>

<body>

 <h3><font face="Verdana">Basic Sorting in DataGrid</font></h3>

 <form runat=server>

 <ASP:DataGrid id="MyDataGrid" runat="server"
 AllowSorting="true"
 OnSortCommand="MyDataGrid_Sort"
 BorderColor="black"
 BorderWidth="1"
 CellPadding="3"
 Font-Name="Verdana"
 Font-Size="8pt"
 HeaderStyle-BackColor="#ccccff"
 HeaderStyle-ForeColor="black"
 />

</form>

</body>
</html>