Click here to Skip to main content
15,894,291 members
Home / Discussions / C#
   

C#

 
SuggestionRe: Draw a Line within a class and inheritance Pin
Richard MacCutchan18-Apr-14 22:04
mveRichard MacCutchan18-Apr-14 22:04 
QuestionPartial Snippet Pin
Mycroft Holmes18-Apr-14 16:30
professionalMycroft Holmes18-Apr-14 16:30 
AnswerRe: Partial Snippet Pin
Richard MacCutchan18-Apr-14 21:59
mveRichard MacCutchan18-Apr-14 21:59 
GeneralRe: Partial Snippet Pin
Mycroft Holmes19-Apr-14 2:38
professionalMycroft Holmes19-Apr-14 2:38 
AnswerRe: Partial Snippet Pin
OriginalGriff19-Apr-14 4:31
mveOriginalGriff19-Apr-14 4:31 
Questiona concept I'm trying to build Pin
solo918-Apr-14 15:07
solo918-Apr-14 15:07 
GeneralRe: a concept I'm trying to build Pin
Richard MacCutchan18-Apr-14 21:57
mveRichard MacCutchan18-Apr-14 21:57 
Questioni want to hyperlink connect with stringquery and also display same hyperlink on other page Pin
Member 1061806718-Apr-14 12:12
Member 1061806718-Apr-14 12:12 
C#
<pre lang="c#">using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Driver.Linq;
public partial class question : System.Web.UI.Page
{
    MongoCollection conection;
    MongoDatabase database;
    string s2;

    protected void Page_Load(object sender, EventArgs e)
    {
        database = new MongoClient("mongodb://avant:avant@127.0.0.1:27017").GetServer().GetDatabase("demo1");//database
        conection = database.GetCollection<ques>("que");

    }

    class ques
    {
        public ObjectId id { get; set; }
        public string question { get; set; }
        public string category { get; set; }
        public string answer { get; set; }
        public string user { get; set; }
        public string name { get; set; }
    }




    //this button is used for view the questions

    protected void Button1_Click(object sender, EventArgs e)
    {
        var query = from x in conection.AsQueryable<ques>() where x.category == "c#" select x;
        var query1 = from r in conection.AsQueryable<ques>() where r.category == "c lang" select r;
        

        Label[] lbch2 = new Label[100];
        HyperLink[] lin = new HyperLink[100];
       


        int k = 0;

        if (DropDownList1.Text == "c#")
        {

            foreach (var var1 in query)
            {
                lin[k] = new HyperLink();

                lbch2[k] = new Label();              
                lin[k].Text = k + ")   " + var1.question;
                lbch2[k].Text = "<br><br>";
                pan1.Controls.Add(lin[k]);
                pan1.Controls.Add(lbch2[k]);
               
              
                s2 = lin2[k].Text;
                lin[k].NavigateUrl = "Default.aspx?t1" + s2;
                k++;
            }
        }
    }
  }

AnswerRe: i want to hyperlink connect with stringquery and also display same hyperlink on other page Pin
Richard Andrew x6418-Apr-14 12:19
professionalRichard Andrew x6418-Apr-14 12:19 
GeneralRe: i want to hyperlink connect with stringquery and also display same hyperlink on other page Pin
Member 1061806718-Apr-14 12:40
Member 1061806718-Apr-14 12:40 
GeneralRe: i want to hyperlink connect with stringquery and also display same hyperlink on other page Pin
Richard Andrew x6418-Apr-14 12:54
professionalRichard Andrew x6418-Apr-14 12:54 
QuestionProperty with "get" only, or a separate method? Pin
Matt U.18-Apr-14 8:09
Matt U.18-Apr-14 8:09 
AnswerRe: Property with "get" only, or a separate method? Pin
OriginalGriff18-Apr-14 8:15
mveOriginalGriff18-Apr-14 8:15 
GeneralRe: Property with "get" only, or a separate method? Pin
Matt U.18-Apr-14 8:16
Matt U.18-Apr-14 8:16 
GeneralRe: Property with "get" only, or a separate method? Pin
OriginalGriff18-Apr-14 8:32
mveOriginalGriff18-Apr-14 8:32 
AnswerRe: Property with "get" only, or a separate method? Pin
Ravi Bhavnani18-Apr-14 8:16
professionalRavi Bhavnani18-Apr-14 8:16 
GeneralRe: Property with "get" only, or a separate method? Pin
Matt U.18-Apr-14 8:19
Matt U.18-Apr-14 8:19 
GeneralRe: Property with "get" only, or a separate method? Pin
Ravi Bhavnani18-Apr-14 8:59
professionalRavi Bhavnani18-Apr-14 8:59 
Questionmarching cubes Pin
Member 1071125918-Apr-14 7:25
Member 1071125918-Apr-14 7:25 
AnswerRe: marching cubes Pin
OriginalGriff18-Apr-14 8:10
mveOriginalGriff18-Apr-14 8:10 
QuestionBackground Substraction and HOG Pin
Member 1042078418-Apr-14 5:42
Member 1042078418-Apr-14 5:42 
QuestionDisplay graph from selected dropdownlist and radiobutton Pin
Syafiqah Zahirah18-Apr-14 0:43
Syafiqah Zahirah18-Apr-14 0:43 
QuestionCS1525: Invalid expression term '<' error Pin
Member 1075622017-Apr-14 6:12
Member 1075622017-Apr-14 6:12 
AnswerRe: CS1525: Invalid expression term '<' error Pin
Wes Aday17-Apr-14 6:29
professionalWes Aday17-Apr-14 6:29 
GeneralRe: CS1525: Invalid expression term '<' error Pin
OriginalGriff17-Apr-14 8:26
mveOriginalGriff17-Apr-14 8:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.