Posts

Showing posts from September, 2011

Unable to cast object of type 'System.Int32' to type 'System.String'

I would say that you should probably always use the ".ToString()" method to cast any datatype into a string childNode.Text = (cmyrows[c][0]).ToString(); //convert int to string        childNode1.Text = (string)cmyrows[c][2]; // type cast: to specify string to string        

TreeStructure of Database

Database Connection: In class1.cs public DataTable GetDataSource( string Query)         {             SqlConnection con = new SqlConnection ();             DataTable dt = new DataTable ();             con.ConnectionString = WebConfigurationManager .ConnectionStrings[ "company" ].ConnectionString;             con.Open();             SqlDataAdapter da = new SqlDataAdapter (Query, con);             da.Fill(dt);             con.Close();             return dt;    ...

SQL Helper

How to get datatable Name from database   Method1: " SELECT table_Name from information_schema.tables where table_type='BASE TABLE'" ; Method2: “SELECT Name FROM dbo.sysobjects where xtype='U'"; How to get Column Name from database table "select column_Name from information_schema.column “ How to get datatable Name,Column Name from database table "select table_Name,column_Name from information_schema.column“

AJAX CONTROL

Image
1.        Goto  web confiq add following controls        < controls >   < add tagPrefix = " ccl " namespace = " AjaxContolToolkit " assembly   = " AjaxContolToolkit " />      </ controls > 2.        Go to  bin folder  ->  include project -> add ajax.dll file from AjaxControl Toolkit 3.        Add  toolsciptmanager  to default.aspx            < asp : ToolkitScriptManager ID ="ToolkitScriptManager1" runat ="server">         </ asp : ToolkitScriptManager > 4.        Create a function < script type = "text/javascript" >     function panelclick()     {    alert( "click" );  ...

Three Tier Architecture

   In  WEB.config do the connection < connectionStrings > < add name = " company " connectionString = " Datasource=MDSWIN48;uid=sa;pwd=Admin2011; Initial Catalog=Company;Integrated Security=SSPI " providerName = " System.Data.SqlClient " /> </ connectionStrings >  2.  Create the Common classlibrary a.        Rename the Class1.cs as CustomerInfo.cs b.       Create get/set method for the data c.        Then save and Build it. Code: namespace COMMON {     public class CustomerInfo     {         private string username;         private string password;         private string id;         public string Username     ...