Posts

Showing posts from August, 2011

Product Review : uCertify prepkit ASP.NET

Image
So i tried the uCertify prepkit for web application development with framework 4.0 (M70-515-VB)


The gui is very cool... as shown in pics...
You can choose from variety of tests like diagnostic, Fixed time, adaptive test etc..These all are descriptive multiple choice questions. 
It has small multiple choice quiz questions and flashcards where you have to type answers.
Anytime During the test you can make notes, a very nice feature.
The quality of the test is very good. The question belongs to the core of the subject. I have seen many other online test kits which do touch only the common things about the topic. But uCertify prepkit is very enrich in the content. Therefore if you score well in this prepkit then i am sure that you will succesfully clear the actual test. I am saying so because i do amateur programming in ASP.net and i took the test and got failed :). It's a best exam simulator i have ever seen and my criteria for saying so is:
1. Lovely GUI.
2. Simplicity.
3. Association of No…

VB.NET Application Crystal Report to PDF converter with ftp uploader

Crystal Report to PDF converter with ftp uploader
This Application converts crystal report with mysql database in to pdf and upload pdf to ftp server running on linux.
1. Create the ODBC connection for mysql from control panel>admin tools> odbc manager. detail http://vinodkotiya.blogspot.com/2011/08/vbnet-with-crystal-report-and-mysql.html
2. in all of crystal report u should have the above connection in rpt files while creating them in crystal designer.
3. put all rpt files in some report folder. Do not have any direct reference to these rpt file in ur vb.net application. The application will scan the report folder and convert all rpt file in to pdf file and put them in pdf folder while uploading via ftp. It will also make a log.
4. open a new web application and use following code.
Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared


Imports System.IO


Imports System.Net


Public Class Form1






Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.Ev…

vb.net Appending a text file to create log..

Here is the procedure to Appending a text file to create log in vb.net
Private Function makeLog() As Boolean

Dim path As String = "log.txt"


Dim sw As StreamWriter






' This text is added only once to the file.


If File.Exists(path) = False Then


' Create a file to write to.


sw = File.CreateText(path)


sw.Flush()


sw.Close()






End If






' This text is always added, making the file longer over time


' if it is not deleted.


sw = File.AppendText(path)


sw.WriteLine("<<<<<<<<<<<<<<<")


sw.WriteLine(lblStatus.Text)


sw.WriteLine(">>>>>>>>>>>>>>>")


sw.Flush()


sw.Close()






'' Open the file to read from.


'Dim sr As StreamReader = File.OpenText(path)


'Dim s As String


'Do While sr.Peek() >= 0


' s = sr.ReadLine()


' Console.WriteLine(s)


'Loop


'sr.Close()


End Function

VB.net Uploading files through ftp.

Using visual studio 2010 and server 2010. I used below function to upload my files to ftp server running on Linux. Initially ftp was not working properly on server 2008. This issue can be resolved if you set ur ftp mode to passive. in windows cmd prompt it may be done using command >quote PASV


C:\>ftp 191.254.1.42
Connected to 191.254.1.42.
220 PMC FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
User (191.254.1.42:(none)): admin
331 Password required for admin.
Password:
230- Linux PMC 2.6.26-2-686-bigmem #1 SMP Sat Dec 26 09:26:36 UTC 2009 i686
230 User admin logged in.
ftp> put mou_summary.pdf
200 PORT command successful.
425 Can't build data connection: Connection timed out.
ftp> put mou_summary.pdf
200 PORT command successful.
425 Can't build data connection: Connection timed out.
ftp> put mou_summary.pdf
421 Timeout (900 seconds): closing control connection.
Connection closed by remote host.
ftp> bye

I created a function in vb.net to upload file via ftp with passiv…

Crystal Reports: Fix for "Load report failed" error when converting to pdf

When i was working on Crystal Report with Visual Studio 2008 vb.net application , i got the load report failed error when converting to pdf format. using vista os.(when i shifted to server 2008 same code works fine. vista has some issues related to security)Here is the code throwing error at cr.Load(thefile)


PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim cr As New ReportDocumentDim cr As ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument()'CrystalReportViewer1.Dispose()'cr.Close()' cr.Dispose()''code for loadDim thefile AsString = "F:\winAppCR1" & "\reports\CrystalReport2.rpt"        cr.Load(thefile)        CrystalReportViewer1.ReportSource = cr        CrystalReportViewer1.Refresh()

''code for exportDim x_opt As ExportOptions = cr.ExportOptions        x_opt.ExportFormatType = ExportFormatType.PortableDocFormat        x_opt.ExportDestinationType …

VB.net with Crystal Report and MySQL using ADO & ODBC.

Image
VB.net with Crystal Report and MySQL using ADO & ODBC.




Before we begin, to use MySQL with VB.NET you will need to download the MySQL Connector/NET which is available from
http://dev.mysql.com.../connector/net/. At the time of writing, the newest version is 6.1. The installer will install
the ADO connector on your system ready for use.
restart visual studio.

Once the connector is installed, start a new project in VB.NET (Im using 2008) and you will then need to add a reference to the connector.

Choose "Add Reference" from the Project menu, then select "Browse" and browse to the installation folder where the connector was installed, c:\prog files\mysql\asemblies\
choose "MySQL.Data.dll" .

For ODBC Connector install

http://www.mysql.com/downloads/connector/odbc/

In Administrative Tools, click Data Sources (ODBC).

Open the ODBC Data Source Administrator.To create a System DSN (which will be available to all users) , select the System DSN tab. To create a User DSN,…

PHP : Accessing Mysql Database

PHP : Accessing Mysql Database
<html><body>
<?php
$con = mysql_connect("localhost","admin","pwd");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}


else
{
mysql_select_db("vinDB", $con);


$result = mysql_query("SELECT * FROM temp");


while($row = mysql_fetch_array($result))
{
dy>
<?php
$con = mysql_connect("localhost","admin","nimda");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}


else
{
mysql_select_db("vinDB", $con);
$result = mysql_query("SELECT * FROM temp");


while($row = mysql_fetch_array($result))
{
echo $row['eid'] . " " . $row['name'];
echo "<br />";
}


}


echo $row['eid'] . " " . $row['name'];
echo "<br />";
}


}


mysql_close($con);
?>
</body>
</html>

php basics

Code for index1.php
<html>
<body>
<?php
echo "hello world <br/>";
$str1 = "vinod";
$str2 = "kotiya";
echo $str1." ".$str2;
if (time()%2 == 0)
echo " <br/> Even Time is " . time();
else
echo "<br/> Odd time is " . time();
for($i=0; $i < 5 ; $i++)
echo "<br/> value of i is " . $i;
echo "<br/> Add : " . add(2,3);
function add($i,$j)
{
return $i+$j;
}
?>
<form action="index2.php" method="post">
Name : <input type="text" name="name" /><br/>
Last Name: <input type="text" name="lname" /><br/>
<input type="submit" value="send" />
</form>
                  </body>
</html>code for index2.php

<html>
<body>
<?php
echo "your name is " . $_POST["name"];
echo "<br/> surname is " . $_POST["l…

Google+ Followers