Exemplo n.º 1
0
        void BtnQueryDBClick(object sender, EventArgs e)
        {
            string db = GetSelectedDB();

            if (db == "")
            {
                return;
            }
            QueryForm f = new QueryForm(mSavedMap, mSavedReduce);

            if (f.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    mSavedMap    = f.MapFunction;
                    mSavedReduce = f.ReduceFunction;
                    string result = mDB.ExecTempView(txtServer.Text, db, mSavedMap, mSavedReduce == ""?null:mSavedReduce, f.StartKey, f.EndKey);
                    // This output really needs formatting, but for now we will just
                    // replace the unix line breaks with windows ones...
                    result = result.Replace("\n", "\r\n");
                    ResultForm f2 = new ResultForm(result);
                    f2.Show();
                }
                catch (Exception ex)
                {
                    StatusBar.Items[0].Text = ex.Message;
                }
            }
        }
Exemplo n.º 2
0
 void BtnQueryDBClick(object sender, EventArgs e)
 {
     string db=GetSelectedDB();
     if(db=="") return;
     QueryForm f=new QueryForm(mSavedMap,mSavedReduce);
     if(f.ShowDialog()==DialogResult.OK)
     {
         try
         {
             mSavedMap=f.MapFunction;
             mSavedReduce=f.ReduceFunction;
             string result=mDB.ExecTempView(txtServer.Text,db,mSavedMap,mSavedReduce==""?null:mSavedReduce,f.StartKey,f.EndKey);
             // This output really needs formatting, but for now we will just
             // replace the unix line breaks with windows ones...
             result=result.Replace("\n","\r\n");
             ResultForm f2=new ResultForm(result);
             f2.Show();
         }
         catch(Exception ex)
         {
             StatusBar.Items[0].Text=ex.Message;
         }
     }
 }