Avatar billede intel4ever Nybegynder
07. juni 2004 - 13:50 Der er 16 kommentarer

class funktion problem

hej jeg prøver på at lave en hjæmmeside i ASP.NET (Programeringssprog: c#)

jeg har lavet en funktion som ser sådan her ud:

"public search2(System.Web.UI.WebControls.ListControl FileTypeValg, System.Web.UI.WebControls.TextBox SearchFor, System.Web.UI.WebControls.ListBox ListBox1, System.Web.UI.WebControls.TextBox Label1, System.Web.UI.WebControls.TextBox Label2, System.Web.UI.WebControls.ListBox FileList, System.Data.SqlClient.SqlDataAdapter StepAdapter, System.Web.UI.WebControls.CheckBox DocTypeAllChek, System.Web.UI.WebControls.CheckBox DocTypeExamplesChek, System.Web.UI.WebControls.CheckBox DocTypePresentationsChek, System.Web.UI.WebControls.CheckBox DocTypeTemplatesChek, System.Web.UI.WebControls.CheckBox DocTypeTrainingChek)"


hvor den siger: "Class, struct, or interface method must have a return type"

jeg nhar prøvet at skrive void men det giver næsten samme resultat hvad gør jeg forkert, bare spørg for flere informationer

MVH. René Kvist
Avatar billede arne_v Ekspert
07. juni 2004 - 13:55 #1
public void search2(

eller

public bool search2(

eller ...
Avatar billede intel4ever Nybegynder
07. juni 2004 - 14:36 #2
det har jeg prøvet samme fejl

jeg kalder funktionen sådan her:

WebApplication1.search.search2(FileTypeValg, SearchFor, ListBox1, Label1, Label2, FileList, System.Data.SqlClient.SqlData, DocTypeAllChek, DocTypeExamplesChek, DocTypePresentationsChek, DocTypeTemplatesChek, DocTypeTrainingChek);
Avatar billede arne_v Ekspert
07. juni 2004 - 16:37 #3
Prøv lige at post lidt mere kode.

Fejl meddelsen passer ikke med situationen hvor der er en retur type.
Avatar billede intel4ever Nybegynder
08. juni 2004 - 08:01 #4
her er "hoved siden" hvor jeg kalder funktionen fra:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
using System.Data.SqlTypes;
using System.Web.Services;




namespace WebApplication1
{
   
   
   
   
    public class WebForm1 : System.Web.UI.Page
    {
        public System.Web.UI.WebControls.Label DN_Application_Name;
        public System.Web.UI.WebControls.Label DN_Application_Name_Page;
        public System.Web.UI.WebControls.Label DN_Application_Name_Index;

        protected System.Web.UI.WebControls.HyperLink HyperLink1;
        protected System.Web.UI.WebControls.CheckBox DocTypeTemplatesChek;
        protected System.Web.UI.WebControls.CheckBox DocTypeExamplesChek;
        protected System.Web.UI.WebControls.CheckBox DocTypePresentationsChek;
        protected System.Web.UI.WebControls.CheckBox DocTypeTrainingChek;
        protected System.Web.UI.WebControls.CheckBox DocTypeAllChek;
        protected System.Web.UI.WebControls.TextBox SearchFor;
        protected System.Web.UI.WebControls.DropDownList FileTypeValg;
        protected System.Web.UI.WebControls.LinkButton LinkButton1;
        protected System.Web.UI.WebControls.Label Label1;
        protected System.Web.UI.WebControls.Label Label2;
        protected System.Web.UI.WebControls.Button SubmitSearch;
        protected System.Web.UI.WebControls.ImageButton ImageButton1;
        protected System.Web.UI.WebControls.ImageButton ImageButton2;
        protected System.Web.UI.WebControls.ImageButton ImageButton4;
        protected System.Web.UI.WebControls.ImageButton ImageButton5;
        protected System.Web.UI.WebControls.ImageButton ImageButton7;
        protected System.Web.UI.WebControls.ImageButton ImageButton3;
        protected System.Web.UI.WebControls.ImageButton ImageButton6;
        protected System.Web.UI.WebControls.ImageButton ImageButton8;
        protected System.Web.UI.WebControls.ImageButton ImageButton9;
        protected System.Web.UI.WebControls.ImageButton ImageButton10;
        protected System.Web.UI.WebControls.ImageButton ImageButton11;
        protected System.Web.UI.WebControls.ImageButton ImageButton12;
        protected System.Web.UI.WebControls.ImageButton ImageButton13;
        protected System.Web.UI.WebControls.ImageButton ImageButton14;
        protected System.Web.UI.HtmlControls.HtmlGenericControl DIAGRAMstartside;
        protected System.Web.UI.WebControls.ListBox ListBox1;
   
        private void Page_Load(object sender, System.EventArgs e)
        {
            //  code to initialize the page here
            DN_Application_Name = new Label();
            DN_Application_Name_Page = new Label();
            DN_Application_Name_Index = new Label();
            DN_Application_Name.Text = "PRG Pages for DPP ";
            DN_Application_Name_Index.Text = "";
           
            SetDefaultButton(this.Page, SearchFor, SubmitSearch);
           
            if(!IsPostBack)
            {
                FillFileList();
            }
       
        }

        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            // This call is required by the ASP.NET Web Form Designer.           
            InitializeComponent();
            base.OnInit(e);
        }
       
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {   
            this.ListBox1.SelectedIndexChanged += new System.EventHandler(this.ListBox1_SelectedIndexChanged);
            this.SubmitSearch.Click += new System.EventHandler(this.SubmitSearch_Click);
            this.DocTypePresentationsChek.CheckedChanged += new System.EventHandler(this.DocTypePresentationsChek_CheckedChanged);
            this.DocTypeTemplatesChek.CheckedChanged += new System.EventHandler(this.DocTypeTemplatesChek_CheckedChanged);
            this.DocTypeExamplesChek.CheckedChanged += new System.EventHandler(this.DocTypeExamplesChek_CheckedChanged);
            this.DocTypeTrainingChek.CheckedChanged += new System.EventHandler(this.DocTypeTrainingChek_CheckedChanged);
            this.DocTypeAllChek.CheckedChanged += new System.EventHandler(this.DocTypeAllChek_CheckedChanged);
            this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
            this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
            this.ImageButton5.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton5_Click);
            this.Load += new System.EventHandler(this.Page_Load);

        }
        #endregion
       
        // Set default Button
        public void SetDefaultButton(Page page, TextBox textControl, Button defaultButton)
        {
            string theScript = @"

<SCRIPT language=""javascript"">

<!--

function fnTrapKD(btn, event){

if (document.all){

  if (event.keyCode == 13){

  event.returnValue=false;

  event.cancel = true;

  btn.click();

  }

}

else if (document.getElementById){

  if (event.which == 13){

  event.returnValue=false;

  event.cancel = true;

  btn.click();

  }

}

else if(document.layers){

  if(event.which == 13){

  event.returnValue=false;

  event.cancel = true;

  btn.click();

  }

}

}

// -->

</SCRIPT>";



            Page.RegisterStartupScript("ForceDefaultToScript", theScript);

            textControl.Attributes.Add("onkeydown", "fnTrapKD(" + defaultButton.ClientID + ",event)");

        }


        // Fill the filelist with files from the database
        private void FillFileList()
        {
            string SQLconStr = ConfigurationSettings.AppSettings["SQLcon"];
            SqlConnection DB_Connection = new SqlConnection(SQLconStr);

            SqlDataAdapter StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data ORDER BY filename asc", DB_Connection);

            DataSet FileList = new DataSet();
            StepAdapter.Fill(FileList, "FileListSet");
           
            ListBox1.DataSource = FileList;
            ListBox1.DataMember = "FileListSet";
            ListBox1.DataTextField = "filename";
            ListBox1.DataValueField = "path";
            ListBox1.DataBind();
       
            Label2.Text = "";
            Label1.Text = "Showing All Files";
        }
       
       
        // Make link to selected file from filelist
        private void ListBox1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            string ValgtEnhed = "";
            string ValgtPath = "";

            ValgtEnhed = ListBox1.SelectedItem.Text.ToString();
            ValgtPath = ListBox1.SelectedItem.Value.ToString();

            HyperLink1.NavigateUrl = "file://fp02-f01\\CF01-GRP\\Projekter\\DPP\\PRG\\Attachements\\Active attachements\\"+ ValgtPath + ValgtEnhed;
        }


        // Fill the filelist with search resaults (search engine)
        private void SubmitSearch_Click(object sender, System.EventArgs e)
        {
            WebApplication1.search.search2(FileTypeValg, SearchFor, ListBox1, Label1, Label2, FileList, System.Data.SqlClient.SqlData, DocTypeAllChek, DocTypeExamplesChek, DocTypePresentationsChek, DocTypeTemplatesChek, DocTypeTrainingChek);
        }

       
        // Checks buttons, changes the way the searchengine works
        private void DocTypeAllChek_CheckedChanged(object sender, System.EventArgs e)
        {
            DocTypeExamplesChek.Checked = false;
            DocTypePresentationsChek.Checked = false;
            DocTypeTemplatesChek.Checked = false;
            DocTypeTrainingChek.Checked = false;         
        }

        private void DocTypeTrainingChek_CheckedChanged(object sender, System.EventArgs e)
        {
            DocTypeAllChek.Checked = false;   
        }

        private void DocTypeTemplatesChek_CheckedChanged(object sender, System.EventArgs e)
        {
            DocTypeAllChek.Checked = false;
        }

        private void DocTypePresentationsChek_CheckedChanged(object sender, System.EventArgs e)
        {
            DocTypeAllChek.Checked = false;
        }

        private void DocTypeExamplesChek_CheckedChanged(object sender, System.EventArgs e)
        {
            DocTypeAllChek.Checked = false;           
        }


        // Button to show all files again
        private void LinkButton1_Click(object sender, System.EventArgs e)
        {
            FillFileList();
        }

        private void ImageButton3_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
       
        }

        private void ImageButton5_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
       
        }

        private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {

        }




    }
}
Avatar billede intel4ever Nybegynder
08. juni 2004 - 08:02 #5
og her er classfilen som funktionen ligger i:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
using System.Data.SqlTypes;


namespace WebApplication1
{
    /// <summary>
    /// The search engine.
    /// </summary>
    public class search
    {
            public void search2(System.Web.UI.WebControls.ListControl FileTypeValg, System.Web.UI.WebControls.TextBox SearchFor, System.Web.UI.WebControls.ListBox ListBox1, System.Web.UI.WebControls.TextBox Label1, System.Web.UI.WebControls.TextBox Label2, System.Web.UI.WebControls.ListBox FileList, System.Data.SqlClient.SqlData, System.Web.UI.WebControls.CheckBox DocTypeAllChek, System.Web.UI.WebControls.CheckBox DocTypeExamplesChek, System.Web.UI.WebControls.CheckBox DocTypePresentationsChek, System.Web.UI.WebControls.CheckBox DocTypeTemplatesChek, System.Web.UI.WebControls.CheckBox DocTypeTrainingChek)
            {
            string FileTypeSearch;
            FileTypeSearch = FileTypeValg.SelectedItem.ToString();
           
            string SQLconStr = ConfigurationSettings.AppSettings["SQLcon"];
            SqlConnection DB_Connection = new SqlConnection(SQLconStr);
           
            string StrSearchFor;
            StrSearchFor = SearchFor.Text.ToString();
            SqlDataAdapter StepAdapter2 = new SqlDataAdapter();
           
           

           
           
            // --- //                                            // --- //
            // --- // searching database depending on checkboxes // --- //
            // --- //                                            // --- //


            // -- all filetype search

            if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeAllChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }
           
            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'YES' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'YES' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'NO' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'NO' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'NO' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'YES' and presentations = 'NO' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'YES' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'YES' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'NO' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'NO' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'NO' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'NO' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("All") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%'  AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }


               
               
                // -- Word filetype search
           
            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeAllChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }
           
            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'YES' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'YES' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'NO' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'NO' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'NO' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'YES' and presentations = 'NO' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'NO' and presentations = 'YES' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'NO' and presentations = 'YES' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'NO' and presentations = 'NO' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'NO' and presentations = 'NO' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'NO' and presentations = 'NO' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W' AND examples = 'NO' and presentations = 'NO' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Word files only";
            }
           
            else if(FileTypeValg.SelectedItem.ToString().Equals("Word") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'W'  AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }





                // -- excel filetype search

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeAllChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }
           
            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'YES' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'YES' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'NO' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'NO' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'NO' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'YES' and presentations = 'NO' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'NO' and presentations = 'YES' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'NO' and presentations = 'YES' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'NO' and presentations = 'NO' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'NO' and presentations = 'NO' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'NO' and presentations = 'NO' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E' AND examples = 'NO' and presentations = 'NO' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Excel files only";
            }
           
            else if(FileTypeValg.SelectedItem.ToString().Equals("Excel") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'E'  AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }



               
               
                // -- powerpoint filetype search

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeAllChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'YES' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'YES' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'NO' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'NO' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'NO' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'YES' and presentations = 'NO' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == true && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'NO' and presentations = 'YES' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'NO' and presentations = 'YES' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'NO' and presentations = 'NO' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'NO' and presentations = 'NO' and templates = 'YES' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == false)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'NO' and presentations = 'NO' and templates = 'NO' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == false && DocTypeTemplatesChek.Checked == false && DocTypeTrainingChek.Checked == true)
            {           
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P' AND examples = 'NO' and presentations = 'NO' and templates = 'NO' and training = 'YES' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing Powerpoint files only";
            }

            else if(FileTypeValg.SelectedItem.ToString().Equals("PowerPoint") && DocTypeExamplesChek.Checked == false && DocTypePresentationsChek.Checked == true && DocTypeTemplatesChek.Checked == true && DocTypeTrainingChek.Checked == false)
            {
                ListBox1.DataSource = "";
                ListBox1.DataBind();
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data WHERE filename like '%" + StrSearchFor + "%' AND filetype = 'P'  AND examples = 'NO' and presentations = 'YES' and templates = 'YES' and training = 'NO' ORDER BY filename asc", DB_Connection);
                Label2.Text = "Showing all filetypes";
            }



                // -- if no one was true. (failesafe)
            else
            {
                ListBox1.DataSource = "";           
                ListBox1.DataBind();
                Label2.Text = "Search Engien Failed! showing all files";   
                StepAdapter = new SqlDataAdapter("SELECT * FROM DPP_data ORDER BY filename asc", DB_Connection);
            }

           
           
           
           
           
            DataSet FileList2 = new DataSet();
            StepAdapter.Fill(FileList2, "FileListSet");
            ListBox1.DataSource = FileList;
            ListBox1.DataMember = "FileListSet";
            ListBox1.DataTextField = "filename";
            ListBox1.DataValueField = "path";
            ListBox1.DataBind();
           
           
           
           
            Label1.Text = "Searching for: " + SearchFor.Text;
           
            }   
   
    }
}
Avatar billede intel4ever Nybegynder
08. juni 2004 - 08:04 #6
tag dig ikke af alle de underlige ting som de mange if sætninger og de tomme tomme knapper
Avatar billede arne_v Ekspert
08. juni 2004 - 08:07 #7
Og fejlen når du compiler er nu ?
Avatar billede intel4ever Nybegynder
08. juni 2004 - 08:14 #8
Class, struct, or interface method must have a return type
Avatar billede arne_v Ekspert
08. juni 2004 - 08:17 #9
Og den angiver hvilken kode ?
Avatar billede intel4ever Nybegynder
08. juni 2004 - 08:19 #10
linje 22 i class filen
Avatar billede intel4ever Nybegynder
08. juni 2004 - 08:26 #11
nogen idé om hvad det kan være
Avatar billede arne_v Ekspert
08. juni 2004 - 08:26 #12
Jeg får altaå:

error CS1001: Identifier expected

fordi der mangler et argument navn efter:

System.Data.SqlClient.SqlData

i argument listen.
Avatar billede intel4ever Nybegynder
08. juni 2004 - 08:48 #13
okay jamen kan du se hvilket
Avatar billede arne_v Ekspert
08. juni 2004 - 09:11 #14
Nej jeg ved ikke hvad et argument skal være.

Men jeg ved at der skal være både en type og et navn.
Avatar billede intel4ever Nybegynder
08. juni 2004 - 09:29 #15
hmmm okay jamen jeg prøver bare at kikke lidt mere på det så...
Avatar billede arne_v Ekspert
21. juni 2004 - 22:23 #16
Kommet videre ?
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester