Franken_.App_Code.DataPipe.GetRows C# (CSharp) Method

GetRows() public method

public GetRows ( string SelectStatement ) : bool
SelectStatement string
return bool
        public bool GetRows(string SelectStatement)
        {
            LastSQL = SelectStatement;
            Bucket.Reset();
            bool Got = false;
            try
            {
                Conn.Open();
                SQL.CommandText = SelectStatement;
                Funnel.Fill(Bucket);
                if (Bucket.Rows.Count > 0)
                {
                    Got = true;
                }
                Conn.Close();
            }
            catch (Exception E)
            {
                if (Conn.State == ConnectionState.Open)
                {
                    Conn.Close();
                }
                ReportError(E.Message, "GetRows");
            }
            return Got;
        }

Usage Example

Example #1
0
        void imageContextEdit_Click(object sender, EventArgs e)
        {
            string ImgID = ((sender as ToolStripMenuItem).GetCurrentParent() as ContextMenuStrip).SourceControl.Name;

            if (db.GetRows("select img_path from images where img_id = " + ImgID))
            {
                ProcessStartInfo startInfo = new ProcessStartInfo(db.DataDirectory + db.GetCell(0, "img_path"));
                //startInfo.Verb = "edit";
                Process.Start(startInfo);

                DialogResult myResult = MessageBox.Show("Launching Image Editor.  After editing, click OK to reload images.", "Edit Image", MessageBoxButtons.OKCancel, MessageBoxIcon.None);
                if (myResult == System.Windows.Forms.DialogResult.OK)
                {
                    RefreshCharList();
                }
            }
        }
All Usage Examples Of Franken_.App_Code.DataPipe::GetRows