Showing posts sorted by relevance for query sql. Sort by date Show all posts
Showing posts sorted by relevance for query sql. Sort by date Show all posts

Sunday 3 August 2014

How To Use Sqlite Database With Csharp

Sqlite Database is the best way of providing portability to our database . Sqlite database is well know for the conditions when developers don't want to mess up with installation of database on the client machine . In case of Desktop applications or Web Applications We often require database . It does not matter any database we use We need to install it .

We can use database for application by install it on Client's machine that may be some messy work that take some time and could be problematic and The Second condition is to host the database to Database Server and client is given the access to that Database But that may include some Usage or disk cost of Database Server that could be costly as the database goes on increasing day by day

So solution to these type of problems is SQLite Database . Actually Sqlite Database is very popular database used in Handheld or mobile applications . The main purpose of using Sqlite Database for these conditions is that Sqlite Database Simply includes the All sql queries that are used to create table in between the application source code and it create a file of database with .mdf extension on client's machine in given location and all data is saved to that location so it can be easily backed up by employee by using simple method of uploading this database file to his / her Mail Account or save it in somewhere else .

Download the Sqlite DLL And sourcecode that will be required in this Application 

Download System.Data.Sqlite Dll File
DOWNLOAD SOURCECODE ZIP FILE


 
Adding System.Data.Sqlite Dll File To Visual Studio


  1. Open Visual Studio and Create a New C# Desktop Application Project by giving it a legal name .
  2. Now In Right Side you can see Solution Explorer 
  3. In Solution Explorer Right Click on Reference and Click on Add Reference

  4. Now Click on Browse and then Click on Browse button to choose Dll file from your computer where you have downloaded it .

  5. Now click on OK after adding dll file .

  6. Now Dll file is successfully Added
  7. Now Finally Add Namespace Using System.Data.Sqlite in top line of your form's .Cs file


Adding Data_Connection Class

Data_connection class will be used to give location where the Sqlite Database .mdf file will be created We are creating class for this as it will be used in number of location that is called code reuse

Steps To Add Class :- 

  1. Right click on Project's folder in solution explorer 
  2. In pop-up menu click on Add Then click on Class
  3. Now a Window appear give a name like Data_connection.cs and Hit ok
  4. Now add the code similar to following code to the class :-


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data.SQLite;
using System.Data;
using System.Windows.Forms;
namespace useSqlitecsharp
{
    class Data_connection
    {
        public string datalocation()
        {
            string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            return "Data Source=" + dir + "\\DBgeeksprogrammings.mdf;";
        }

    }
}
5. Now Save all

Adding Code for Creating Table , Inserting Data and Showing Inserted Data

Now we are going to create table using csharp code by passing queries into the code then we pass insert query then we show the result
Add the code similar to following code to your form  :-

Main Terms Used in Code

1. SQLiteConnection :- This is class that is used to establish connection to the sqlite database for creating table , inserting data or to pass any query to database we must first establish connection to database and open the port for connection this is accomplished by making object of this class

2. SQLcommand :- This class is used to pass the sql queries . This requires the Sqlconnect object to be passed also to open to tell the command which instance of database is used for executing the queries that are passed to it .

3. SqlDataAdapter :- This class is used to store the result of executed query and hold to put it in some other variable or datatable


ERROR INFORMATION :- It may be possible that you may go through an error that always exist when we you are attempting first time with sqlite database The error details is shown in image below and Its solution is given in link below


CLICK HERE FOR ERROR SOLUTION
ERROR SOLUTION

Csharp ( C# ) CODE  :-


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SQLite;

namespace useSqlitecsharp
{
    public partial class Form1 : Form
    {
        Data_connection dbobject = new Data_connection();
        SQLiteConnection SQLconnect = new SQLiteConnection();
        public Form1()
        {
            InitializeComponent();
        }
     
        private void button1_Click(object sender, EventArgs e)
        {
            SQLiteCommand SQLcommand = new SQLiteCommand();
            SQLcommand = SQLconnect.CreateCommand();
            SQLcommand.CommandText = "CREATE TABLE IF NOT EXISTS "+textBox1.Text+"( Username TEXT, Password TEXT);";
            SQLcommand.ExecuteNonQuery();
            SQLcommand.Dispose();

            MessageBox.Show("Table Created");
        }



        private void Form1_Load(object sender, EventArgs e)
        {
            SQLconnect.ConnectionString = dbobject.datalocation();
            SQLconnect.Open();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SQLiteCommand cmd = new SQLiteCommand();
            cmd = SQLconnect.CreateCommand();
            cmd.CommandText = "insert into " + textBox1.Text + " (Username,Password)  values (@username,@password)";
            cmd.Parameters.AddWithValue("@username", textBox2.Text);
            cmd.Parameters.AddWithValue("@password", textBox3.Text);
            cmd.ExecuteNonQuery();
            cmd.Dispose();

            MessageBox.Show("Data Inserted");
        }



        private void button3_Click(object sender, EventArgs e)
        {
            SQLiteCommand cmd = new SQLiteCommand("select * from "+textBox1.Text , SQLconnect);
            SQLiteDataAdapter da = new SQLiteDataAdapter();
            DataTable dt = new DataTable();
            da.SelectCommand = cmd;
            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                dataGridView1.DataSource = dt;
            }
            else
            {
                MessageBox.Show("No Data Exist in Table");
            }
        }

    }
}

































Wednesday 21 May 2014

How to use mysql database in csharp

INTRODUCTION


In this article i am going to show how to connect a csharp database with mysql database and how to perform basic operations like inserting record in database , delete a specific record from database , updating a specific record and viewing all data and binding the data to datagridview . Mostly with Csharp Applications you have used MSSQL database but we can also use mysql database for this purpose
DOWNLOAD MYSQL WITH CSHARP APP


REQUIREMENTS

  • Visual Studio 2010 or Visual Studio 2012 
  • MYSQL Database installed with admin roles
  • Dot/connector connec

WHAT WE ARE GOING TO COVER


In this Article we are going to cover the following points
  1. Connect Csharp with mysql
  2. Insert data in mysql database with Csharp code
  3. Delete data in mysql database with Csharp code
  4. Update data in mysql database with Csharp code
  5. Select data in mysql database with Csharp code

CREATING DATABASE


First of Start your Wamp server or Xamp server services This will start Phpmyadmin where all database or SQL related work will be done . Phpmyadmin will be used for create new database schemas and other database oprations are done.

  • Start Wamp / xampp server

How to use mysql database in csharp
  • Then Click on phpMyAdmin as shown in Image above .
  • Now you will get a screen like the image below

    How to use mysql database in csharp
  • If you are using default password for Phpmyadmin then directly click on Go button . Then you will get a screen like below 
  • Then click on Databases as shown in image below to create a new database that will be required for this Application
    How to use mysql database in csharp
  • Then you will get window as shown below Fill up the Database name and Click on Create button
    How to use mysql database in csharp
  • After database is created Now Run the database script we have provided in this tutorial in next steps and run this script as shown in image below ........Just go to sql Tab and paste full script there.

    How to use mysql database in csharp
    • Remember one thing use same name of database as i have given in the snapshot

    DOWNLOAD DATABASE SCRIPT FILE

    Database Script File

    DOWNLOAD FULL PROJECT WITH CODE

    Download Complete project How to use mysql database in csharp

    DOWNLOAD MYSQL CONNECTOR DLL's FOR DOTNET

    For connecting Mysql with Csharp in dotnet you must have connector . you require Connector/NET for mysql connectivity with csharp . you can download Mysql connector / Net from link below :-

    Download Dotnet connector for mysql and csharp


    HOW TO USE MYSQL DLL's

    STEPS :- 

    • Right Click on Solution Name
    • In pop-up menu click on Add Reference
      How to use mysql database in csharp
    • Now select Mysql.Data and Click ok
      How to use mysql database in csharp
    • you can also browse for dll downloaded from Browse Tab
      How to use mysql database in csharp
    • Now MySQL.Data dll file will be added successfully to solution .

    INSERT RECORD IN MYSQL DATABASE USING CSHARP CODE


    How to use mysql database in csharp
    CODE :-
      con.Open();
                MySqlCommand cmd = new MySqlCommand("insert into table1(name,branch,phone) values(@name,@branch,@phone)", con);
                cmd.Parameters.AddWithValue("@name", textBox1.Text);
                cmd.Parameters.AddWithValue("@branch", textBox2.Text);
                cmd.Parameters.AddWithValue("@phone", Convert.ToInt32(textBox3.Text));

                cmd.ExecuteNonQuery();
                con.Close();
                MessageBox.Show("Record Inserted");

    EXPLANATION :- 
    1. First Connection is opened to mysql connection using connection string
    2. Then Using MySqlCommand class we are passing insert query to mysql database using con object that is used for establishing connection to mysql database
    3. Then @name,@branch,@phone are parameters given to query to dynamically pass data to query
    4. Then parameters are passed to query dynamically using following line of code
      cmd.Parameters.Addwithvalue('parametername' , 'value' );
    5. cmd.ExecuteNonQuery is used to execute the query in cmd object to database 
    6. con.close closes the connection to the database

    DELETE RECORD IN MYSQL DATABASE USING CSHARP CODE                                      


    How to use mysql database in csharp

    CODE :-

    con.Open();
                if (comboBox1.Text != "")
                {
                    MySqlCommand cmd = new MySqlCommand("delete from table1 where id=@id", con);
                    cmd.Parameters.AddWithValue("@id", comboBox1.Text);
                                cmd.ExecuteNonQuery();                                                                                                                   
                                 con.close();


    EXPLANATION :- 

    1. First Connection is opened to mysql connection using connection string
    2. Then Using MySqlCommand class we are passing insert query to mysql database using con object that is used for establishing connection to mysql database
    3. Then @id is parameter given to query to dynamically pass data to query
    4. Then parameters are passed to query dynamically using following line of code
      cmd.Parameters.Addwithvalue('parametername' , 'value' );
    5. cmd.ExecuteNonQuery is used to execute the query in cmd object to database 
    6. con.close closes the connection to the database

    UPDATE RECORD IN MYSQL DATABASE USING CSHARP CODE


    How to use mysql database in csharp

    CODE :-

     MySqlCommand cmd = new MySqlCommand("update table1 set name=@name,branch=@branch,phone=@phone where id=@id", con);
                cmd.Parameters.AddWithValue("@name",textBox6.Text );
                cmd.Parameters.AddWithValue("@branch",textBox5.Text );
                cmd.Parameters.AddWithValue("@phone",textBox4.Text);
                cmd.Parameters.AddWithValue("@id",comboBox2.Text  );
              
                cmd.ExecuteNonQuery();
                MessageBox.Show("Record Updated");

    EXPLANATION :- 

    1. First Connection is opened to mysql connection using connection string
    2. Then Using MySqlCommand class we are passing insert query to mysql database using con object that is used for establishing connection to mysql database
    3. Then @name,@branch,@phone,@id are parameters given to query to dynamically pass data to query to state which field value are to be replaced
    4. Then parameters are passed to query dynamically using following line of code
      cmd.Parameters.Addwithvalue('parametername' , 'value' );
    5. cmd.ExecuteNonQuery is used to execute the query in cmd object to database 
    6. con.close closes the connection to the database

    SELECT RECORD IN MYSQL DATABASE USING CSHARP CODE


    How to use mysql database in csharp

    CODE :-


     MySqlCommand cmd = new MySqlCommand("select * from table1 where id=@id", con);
                cmd.Parameters.AddWithValue("@id", comboBox2.Text);
                MySqlDataAdapter da = new MySqlDataAdapter();
                da.SelectCommand = cmd;
                DataTable dt = new DataTable();
                da.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    textBox6.Text =dt.Rows [0][1].ToString ();
                        textBox5.Text =dt.Rows [0][2].ToString ();
                        textBox4.Text = dt.Rows[0][3].ToString();
                }


    EXPLANATION :- 

    1. First Connection is opened to mysql connection using connection string
    2. Then Using MySqlCommand class we are passing insert query to mysql database using con object that is used for establishing connection to mysql database
    3. Then @name,@branch,@phone,@id are parameters given to query to dynamically pass data to query to state which field value are to be replaced
    4. Then parameters are passed to query dynamically using following line of code
      cmd.Parameters.Addwithvalue('parametername' , 'value' );
    5. Then we have used MySqlDataAdapter that act as a pipeline between database and csharp app . It takes or select query from csharp application and then make interface or link to database and execute the query in database and get result returned by query executed in database
    6. Then it fill the returned result in placeholder called DataTable that saves data returned from or retrieved from database into tabulated form
    7. Now if (dt.Rows.Count >0) checks if dt contains some item then put the data in respective text fields

    Full Code For Insert update delete and select Data from Mysql in Csharp Application  ( C# )


    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using MySql;
    using MySql.Data;
    using MySql.Data.MySqlClient;

    namespace mysql
    {
        public partial class Form1 : Form
        {
           public  MySqlConnection con = new MySqlConnection("server=localhost;Uid=root;pwd=;Database=sqldotnet");
            public Form1()
            {
                InitializeComponent();
            }

            private void Form1_Load(object sender, EventArgs e)
            {
                retrieve();
            }
            public void retrieve()
            {

                {
                    MySqlCommand cmdsel = new MySqlCommand("select *  from table1 ", con);
                    MySqlDataAdapter dasel = new MySqlDataAdapter();
                    dasel.SelectCommand = cmdsel;
                    DataTable dtsel = new DataTable();
                    dasel.Fill(dtsel);
                    dataGridView1.DataSource = dtsel;
                }
                {
                    int cnt = comboBox1.Items.Count;
                    for (int counter = 0; counter < cnt; counter++)
                    {
                        comboBox1.Items.RemoveAt(0);
                        comboBox2.Items.RemoveAt(0);
                    }
                }
                MySqlCommand cmd = new MySqlCommand("select id  from table1 ", con);
                MySqlDataAdapter da = new MySqlDataAdapter();
                da.SelectCommand = cmd;
                DataTable dt = new DataTable();
                da.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    int cnt = dt.Rows.Count;
                    for (int counter = 0; counter < cnt; counter++)
                    {
                        comboBox1.Items.Add(dt.Rows[counter][0].ToString());
                        comboBox2.Items.Add(dt.Rows[counter][0].ToString());
                    }
                }
                comboBox1.Text = "";
                comboBox2.Text = "";
            }
       
    //Delete Record
            private void button2_Click_1(object sender, EventArgs e)
            {
                con.Open();
                if (comboBox1.Text != "")
                {
                    MySqlCommand cmd = new MySqlCommand("delete from table1 where id=@id", con);
                    cmd.Parameters.AddWithValue("@id", comboBox1.Text);
                    cmd.ExecuteNonQuery();
                    retrieve();
                }
                MessageBox.Show("Record Deleted");
            }
    //select Data
            private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
            {
                MySqlCommand cmd = new MySqlCommand("select * from table1 where id=@id", con);
                cmd.Parameters.AddWithValue("@id", comboBox2.Text);
                MySqlDataAdapter da = new MySqlDataAdapter();
                da.SelectCommand = cmd;
                DataTable dt = new DataTable();
                da.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    textBox6.Text =dt.Rows [0][1].ToString ();
                        textBox5.Text =dt.Rows [0][2].ToString ();
                        textBox4.Text = dt.Rows[0][3].ToString();
                }
            }
    //Update Data
            private void button3_Click_1(object sender, EventArgs e)
            {
                MySqlCommand cmd = new MySqlCommand("update table1 set name=@name,branch=@branch,phone=@phone where id=@id", con);
                cmd.Parameters.AddWithValue("@name",textBox6.Text );
                cmd.Parameters.AddWithValue("@branch",textBox5.Text );
                cmd.Parameters.AddWithValue("@phone",textBox4.Text);
                cmd.Parameters.AddWithValue("@id",comboBox2.Text  );
             
                cmd.ExecuteNonQuery();
                MessageBox.Show("Record Updated");
                retrieve();
            }
    //Insert Data
            private void button1_Click_1(object sender, EventArgs e)
            {
                con.Open();
                MySqlCommand cmd = new MySqlCommand("insert into table1(name,branch,phone) values(@name,@branch,@phone)", con);
                cmd.Parameters.AddWithValue("@name", textBox1.Text);
                cmd.Parameters.AddWithValue("@branch", textBox2.Text);
                cmd.Parameters.AddWithValue("@phone", Convert.ToInt32(textBox3.Text));

                cmd.ExecuteNonQuery();
                con.Close();
                MessageBox.Show("Record Inserted");
                retrieve();
            }
        }
    }


    Monday 10 June 2013

    Saturday 21 May 2016

    Convert Date Format To dd/mm/yy in Sql Server


    If you Mssql Server is Using Some Other Date Format For Insert Date in Date Column Then Possibly Default Date format is set to US Date Format ( mm/dd/yy ) and if you want to insert date in dd/mm/yy . In order to insert date in this format you need to set Date Format to French / British ( dd/mm/yy )

    So first I recommend you to Use any of Jquery Date Picker and pass the selected date / datetime as below to Insert Query as Below -

    insert Table_Name (Date_Column)  values (convert(datetime,'18-06-12 10:34:09 PM',103));
    
    Here second parameter 103 is For French Date Format dd/mm/yyyy .If you want to have dd/mm/yy then use 3 in that parameter

    Different Types of Date Format Code as As Below - 

    Without century (yy) (1)With century (yyyy)StandardInput/Output (3)
    -0 or 100 (1,2)Default for datetime and smalldatetimemon dd yyyy hh:miAM (or PM)
    1101U.S.1 = mm/dd/yy

    101 = mm/dd/yyyy
    2102ANSI2 = yy.mm.dd

    102 = yyyy.mm.dd
    3103British/French3 = dd/mm/yy

    103 = dd/mm/yyyy
    4104German4 = dd.mm.yy

    104 = dd.mm.yyyy
    5105Italian5 = dd-mm-yy

    105 = dd-mm-yyyy
    6106 (1)-6 = dd mon yy

    106 = dd mon yyyy
    7107 (1)-7 = Mon dd, yy

    107 = Mon dd, yyyy
    8108-hh:mi:ss
    -9 or 109 (1,2)Default + millisecondsmon dd yyyy hh:mi:ss:mmmAM (or PM)
    10110USA10 = mm-dd-yy

    110 = mm-dd-yyyy
    11111JAPAN11 = yy/mm/dd

    111 = yyyy/mm/dd
    12112ISO12 = yymmdd

    112 = yyyymmdd
    -13 or 113(1,2)Europe default + millisecondsdd mon yyyy hh:mi:ss:mmm(24h)
    14114-hh:mi:ss:mmm(24h)
    -20 or 120 (2)ODBC canonicalyyyy-mm-dd hh:mi:ss(24h)
    -21 or 121 (2)ODBC canonical (with milliseconds) default for time, date, datetime2, and datetimeoffsetyyyy-mm-dd hh:mi:ss.mmm(24h)
    -126 (4)ISO8601yyyy-mm-ddThh:mi:ss.mmm (no spaces)

    Note: When the value for milliseconds (mmm) is 0, the millisecond value is not displayed. For example, the value '2012-11-07T18:26:20.000 is displayed as '2012-11-07T18:26:20'.
    -127(6, 7)ISO8601 with time zone Z.yyyy-mm-ddThh:mi:ss.mmmZ (no spaces)

    Note: When the value for milliseconds (mmm) is 0, the milliseconds value is not displayed. For example, the value '2012-11-07T18:26:20.000 is displayed as '2012-11-07T18:26:20'.
    -130 (1,2)Hijri (5)dd mon yyyy hh:mi:ss:mmmAM

    In this style, mon represents a multi-token Hijri unicode representation of the full month's name. This value will not render correctly on a default US installation of SSMS.
    -131 (2)Hijri (5)dd/mm/yyyy hh:mi:ss:mmmAM

    Sunday 25 January 2015

    Crud Operation in AngularJS With Bootstrap


    In My Previous Article I explored about How to setup angularjs in Visual Studio and also Explored concepts of What , why and when To use AngularJS . In this article I am going to do CRUD Operation in AngularJS . CRUD operations means Insert , view , Update and Delete Data In Database . CRUD operations are most important thing that you must practice to create Applications either simple or complex in AngularJS or in any other Language or Technology . I am giving a simple code and easy sample that you can use to Perform CRUD operations in AngularJS using .NET technology 

    Download the Sample Code from Link Below .

    Download Code



    How to setup/Run this sample 


    1. First Download the code 
    2. Then Open Web.config file and update the connection string to your sqlserver connection string by first making database in you sql server .
    3. You need to Deal with CODE First Data migration Commands you can see these command in  link below :-

    Data Migration


    Snapshots

    View Data From Database AngularJS

    Insert Data In Database AngularJS

    Delete Data from Database AngularJS

    Update Data From Database AngularJS

    Wednesday 12 June 2013

    datediff in sql

    Structured Query Language Provides Several Functions to perform date and time related operations. These functions allow you to add dates , times. To Find difference between dates and time etc.

    1. CurrentDate :- Current Date is used to display current date according to date set in computer system.

    Sunday 26 January 2014

    Error dnndev/desktopmodules/ could not be found

    http://geeksprogrammings.blogspot.com/2014/01/donetnuke.html
    geeksprogrammings.blogspot.in

     DotNetNuke is one of best Web Content Management System Based on Microsoft .Net. The main ease is it's community Edition is OpenSource. After successfull installation of DotnetNuke if you want to develop your own modules for Dotnetnuke .you require following things

    1. Microsoft Visual Studio
    Download Visual Studio 2010

    2. Microsoft Sql Server
    Download SqlServer 2008 32/64 Bit

    3 DotNetNuke C# Compiled Module  OR DotNetNuke Vb# Compiled Module
    DotNetNuke C# / Vb Compiled Module For vs 2010

    First I will recommend if you are using only one website of dotnetnuke at one time one one Host or computer . Put all your website files in C:\inetpub\wwwroot that will be ease not put it in folder in wwwroot as it also works in folder but there could be easy url if you keep them in wwwroot


    Configure Host File

    1. Press windowskey +r from keyboard
    2. In Run dialog Box typein "c:\WINDOWS\system32\drivers\etc" and Hit Enter
    3. Now in New window opened right click on hosts file and open it in your favourite notepad editor
    4. Now put the following line in it and it looks something like in image below
    Put this line :-
    127.0.0.1       dnndev
    5. Save this file and close it
    http://geeksprogrammings.blogspot.com/2014/01/donetnuke.html
    geeksprogrammings.blogspot.in

                          e.g. Hosts file

    6. Now check it its done properly
    7. To check it open any browser Typein- "dnndev/" and Hit enter
    8. if your dotnetnuke site opens then host file configuration done.


    Installation of C# Compiled Module Development 

    1. Download DotNetNuke C# Compiled Module  OR DotNetNuke Vb# Compiled Module
    DotNetNuke C# / Vb Compiled Module For vs 2010

    2. Installing the Visual Studio Template is very straight forward.
    3. First close all instances of VS2008  
    4. Now copy the ZIP file that you downloaded from Codeplex in previous step
    5. Now  paste this ZIP file into a very specific folder.
    6. Open the following folder "My Documents\Visual Studio 2008\Templates folder". 
    7. Within that folder go into ProjectTemplates\Visual C#\
    8. within the Visual C# folder  simply create a new folder Web folder
    9. Place zip file in web folder
    10.  Now open  visual studio 2010 and click on file -> New Project 
    11. christoc.com C# compiled module template give filename and click ok

    ERROR

    The Web Application Project hello is configured to use IIS. The Web server "http://dnndev/desktopmodules/hello/' could not be found."


    Solution

    Now we will do configuration for module development. check Which Version of IIS you are using .Follow the steps below to know which version of IIs you are using

    Steps To Know IIS Version

    1. Press windowskey +r from keyboard
    2. In Run dialog Box typein "inetmgr" and Hit Enter
    3. Now click on Help menu item in Menu Bar
    4. click on About Internet Information Services
    5. This gives version of IIs you are using like in image below
    http://geeksprogrammings.blogspot.com/2014/01/donetnuke.html
    geeksprogrammings.blogspot.in



    6. Now depending on version using steps below


    Configure Bindings In IIS 5

    1. Press windowskey +r from keyboard
    2. In Run dialog Box typein "inetmgr" and Hit Enter
    3. This opens Internet Information Services
    4. Right click on Default WebS ite
    5. click on Properties. This opens Default Website Properties

    http://geeksprogrammings.blogspot.com/2014/01/donetnuke.html

    6. Focus on Web Site Tab under Web Site Identification Section
    7. In this section you see Advance Button after Ip Address Label
    8. click on Advanced Button
    9. It opens Advanced Multiple Web Site configuration window
    11. 10. Now click on Add button under Multiple identities for this Web site
    http://geeksprogrammings.blogspot.com/2014/01/donetnuke.html
    geeksprogrammings.blogspot.in


    12. Put Ip Address field equals to All Unassigned
    13. Put TCP Port equals to 80
    14. Put Host Header Name equals to dnndev
    15. click ok ....again click ok on other window
    16. At last click apply and ok to close properties window


    Configure Bindings In IIS 7

    1. Press windowskey +r from keyboard
    2. In Run dialog Box typein "inetmgr" and Hit Enter
    3. This opens Internet Information Services
    4. In the Connections pane, expand the server name, expand Sites, and then click the Web site on which you want to configure the bindings.
    5. In the Actions pane, click Bindings
    6. In the Site Bindings dialog box, click Add.
    7. In the Add Site Binding dialog box, add the binding information
    to solve dotnetnuke error add binding to iis
    geeksprogrammings.blogspot.in


    8.Put Ip Address field equals to All Unassigned
    9. Put Host Header Name equals to dnndev
    10 click ok

    For any more problem or for Configure Bindings In IIS 7 or other problem you can comment here i am here to help you anytime

    Thursday 20 August 2015

    Difference Between Stored Procedure and Functions Sql

    Stored Procedure and Functions

     

    1. Function Must Return Value

       For Stored Procedure it's Not Must to return value it's optional 

    2. Stored Procedures are pre-compile objects which are compiled for 
    first time and its compiled format is saved which executes (compiled code) whenever it is called 

    But Function is compiled and executed every time when it is called

    3. Function can Accept only Input Parameters
       But Stored Procedure Can Accept Both Input and Output Parameters

    4. Functions can be called from Procedure whereas Procedures cannot be called from Function

    5. Functions Like Views only Accept Data Select Statements It does not Allow the Permanent Storage of data so it does not allows DML statements like Insert , Update , Delete

    Whereas Store Procedure Allows All type of DML statements like Insert , Update and also Select Statements.

    6. Funtions can be used in Select Statements like views to View data 
    But Stored Procedure Cannot be Embedded in Select Statements

    7.
     

    Friday 7 June 2013

    Thursday 28 April 2016

    Codeigniter open_basedir_restriction in effect



    Error :

    Message: mkdir(): open_basedir restriction in effect. File() is not within the allowed path(s): (/home/thelazyppl/:/home/thelazyppl:/tmp:/usr/local/lib/php/)

    Filename: drivers/Session_files_drivers.php

    Details About Error :

    CodeIgniter installation is trying to save its session files to somewhere that is unwritable .  I would like to recommend you store sessions in database . You need to do this settings in config.php file Under Application -> Config Folder in Your CodeIgniter Project Default Structure

    In My Case I was using CodeIgniter3 Version . You Can Use The Below User Guide Link To Make Configurations Required For Solving this error properly 

    User Guide For CodeIgniter 3 :User Guide CodeIgniter3 Open_basedir_restriction in effect

    Sure Short Solution For CodeIgniter 3 :- 


    • Navigate to your project folder - Under Application folder in Codeigniter go Under Config Folder
    • Then Open Config.php file Search For below line of code$config['sess_save_path'] = NULL;
    • And Replace this line of code with line of code below -
      $
      config['sess_save_path'] = '/tmp';


    The better option would be to use the database driver, for which the details are just below that.
    If you were having these issues on CodeIgniter 2, you would need definitely need to enable the database. To do this you would change the $config['sess_use_database'] option to TRUE and then run the SQL shown in the CodeIgniter 2 user guide.