Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

foryou

@foryou
About
Posts
60
Topics
25
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to open in local existing site created by joomla?
    F foryou

    password or username incorrect or access level

    Linux, Apache, MySQL, PHP help tutorial question

  • How to open in local existing site created by joomla?
    F foryou

    Thank you Marc Firth I followed your advice and it works but I have a problem I can not log to Administrator. I used the password they gave me it is the same that the password in table jos_users.

    Linux, Apache, MySQL, PHP help tutorial question

  • How to open in local existing site created by joomla?
    F foryou

    hello! It gave me a site created by joomla to make the change and administer, but I do not how. The problem is that all of joomla tutorials are explain how to create a site from zero: how does it work on an existing site ? thank you for your help.

    Linux, Apache, MySQL, PHP help tutorial question

  • select where only
    F foryou

    Thanks scottgp it works.:)

    Database tutorial

  • select where only
    F foryou

    Hi! I have a table Validation: Id_student --- - id_semestre ----- id_validation 102----------- - 1 ---------------- 4 102----------- - 1 ---------------- 3 -- 102----------- - 2 ---------------- 4 103----------- - 1 ---------------- 4 104----------- - 2 ---------------- 3 104----------- - 2 ---------------- 4 I want to select students who have in semestre 2 id_validation = 4 only . in the example i want have : 102 students, not 102 and 104 thank you.

    Database tutorial

  • An SQL Statistics
    F foryou

    Thanks Mycroft Holmes; Groupby gives me no count of student in any city

    WITH r1
    AS (SELECT CAPITALISE_SEMESTRE_1.NUM_INSCRIPTION,
    CAPITALISE_SEMESTRE_1.CODE_SEMESTRE , CAPITALISE_SEMESTRE_1.CODE_TYPE_RELATION_SEMESTRE ,CAPITALISE_SEMESTRE_1.ann_uni

                         FROM         CAPITALISE\_SEMESTRE AS CAPITALISE\_SEMESTRE\_1 WHERE  (CAPITALISE\_SEMESTRE\_1.CODE\_TYPE\_RELATION\_SEMESTRE = 4) AND (CAPITALISE\_SEMESTRE\_1.CODE\_SEMESTRE = 2)), 
    

    r2 AS
    (SELECT CAPITALISE_SEMESTRE.NUM_INSCRIPTION AS Expr1, CAPITALISE_SEMESTRE.CODE_SEMESTRE AS Expr2,
    CAPITALISE_SEMESTRE.ann_uni AS Expr4
    FROM CAPITALISE_SEMESTRE AS CAPITALISE_SEMESTRE

      WHERE      (CAPITALISE\_SEMESTRE.ann\_uni = '2008/2009') AND (CAPITALISE\_SEMESTRE.CODE\_SEMESTRE = 1))
    SELECT     r1\_1.NUM\_INSCRIPTION
     FROM         r1 AS r1\_1 INNER JOIN
                            r2 AS r2\_1 ON r1\_1.NUM\_INSCRIPTION = r2\_1.Expr1
    
    Database database tutorial

  • An SQL Statistics
    F foryou

    Hi! I work on an intranet site of a university(sqlserver2005) and I need to do statistics for example I need to count the students new in the semester 2 for each city: Here is the SQL query that selects the new students in semester 2:

    WITH r1 AS (SELECT CAPITALISE_SEMESTRE_1.NUM_INSCRIPTION, CAPITALISE_SEMESTRE_1.CODE_SEMESTRE , CAPITALISE_SEMESTRE_1.ann_uni, SEMESTRE_1.LIBELLE_SEMESTRE_AR,
    TYPE_RELATION_SEMESTRE_1.LIBELLE_TYPE_RELATION_SEMESTRE
    FROM CAPITALISE_SEMESTRE AS CAPITALISE_SEMESTRE_1 INNER JOIN
    SEMESTRE AS SEMESTRE_1 ON CAPITALISE_SEMESTRE_1.CODE_SEMESTRE = SEMESTRE_1.CODE_SEMESTRE INNER JOIN
    TYPE_RELATION_SEMESTRE AS TYPE_RELATION_SEMESTRE_1 ON
    CAPITALISE_SEMESTRE_1.CODE_TYPE_RELATION_SEMESTRE = TYPE_RELATION_SEMESTRE_1.CODE_TYPE_RELATION_SEMESTRE
    WHERE (CAPITALISE_SEMESTRE_1.CODE_TYPE_RELATION_SEMESTRE = 4) AND (CAPITALISE_SEMESTRE_1.CODE_SEMESTRE = 2)),
    r2 AS
    (SELECT CAPITALISE_SEMESTRE.NUM_INSCRIPTION AS Expr1, CAPITALISE_SEMESTRE.CODE_SEMESTRE AS Expr2,
    SEMESTRE.LIBELLE_SEMESTRE_AR AS Expr3,CAPITALISE_SEMESTRE.ann_uni AS Expr4
    FROM CAPITALISE_SEMESTRE AS CAPITALISE_SEMESTRE INNER JOIN
    SEMESTRE AS SEMESTRE ON CAPITALISE_SEMESTRE.CODE_SEMESTRE = SEMESTRE.CODE_SEMESTRE INNER JOIN
    TYPE_RELATION_SEMESTRE AS TYPE_RELATION_SEMESTRE ON
    CAPITALISE_SEMESTRE.CODE_TYPE_RELATION_SEMESTRE = TYPE_RELATION_SEMESTRE.CODE_TYPE_RELATION_SEMESTRE
    WHERE (CAPITALISE_SEMESTRE.ann_uni = @ann_uni) AND (CAPITALISE_SEMESTRE.CODE_SEMESTRE = 1))
    SELECT r1_1.NUM_INSCRIPTION, r1_1.ann_uni,r1_1.CODE_SEMESTRE, r1_1.LIBELLE_SEMESTRE_AR, r1_1.LIBELLE_TYPE_RELATION_SEMESTRE, r2_1.Expr1,
    r2_1.Expr2, r2_1.Expr3, r2_1.Expr4
    FROM r1 AS r1_1 INNER JOIN
    r2 AS r2_1 ON r1_1.NUM_INSCRIPTION = r2_1.Expr1

    but I do not know how to calculate the number for each city: Number of sudent new in semester2------------City 12222---------------------------------city1 123----------------------------------city2 Thanks.

    Database database tutorial

  • The object must implement IConvertible
    F foryou

    Thank you very much Blue_Boy it works

    ASP.NET help question

  • The object must implement IConvertible
    F foryou

    Hi!! I have this error message: "The object must implement IConvertible." in this line myAdapter.Fill(ds, "Table1"); my code is: private void BindData() { try { SqlConnection myConnection = new SqlConnection(ConnectionString); SqlCommand myCommand = new SqlCommand("SP_S1", myConnection); myCommand.Parameters.Add("@ch1", SqlDbType.VarChar, 30).Value = DropDownList1.SelectedItem; myCommand.CommandType = CommandType.StoredProcedure; SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand); DataSet ds = new DataSet(); myAdapter.Fill(ds, "Table1"); myConnection.Open(); myCommand.ExecuteNonQuery(); GridView1.DataSource = ds; GridView1.DataBind(); myConnection.Close(); } catch (Exception) { } } someone could help me? Thanks.

    ASP.NET help question

  • get gridview row values on rowcommand event
    F foryou

    Hi! I have a gridview with TemplateField column i need to get gridview row values on rowcommand event ,to update a gridview row how? im writing GridViewRow rf =GridView1.Rows(e.CommandArgument); n1 = rf.Cells[0].Text ; but it doesn't work!! Thanks

    ASP.NET question announcement

  • Update a gridview row without edit
    F foryou

    Thank you yusuf! I'm sorry I speak badly English. in place of the method edit update cancel I want : having a button for each row of the GridView and if I click on this button I will update the line.

    ASP.NET question announcement

  • Update a gridview row without edit
    F foryou

    Hi! I work with C # I want update my columns in my GridView without going through edit : for each row I click update button to update the line how? Thank you.

    ASP.NET question announcement

  • value of a cell of selected row
    F foryou

    Thank you Greg Chelstowski; I tried your code and there:

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
    GridViewRow row = GridView1.Rows[GridView1.SelectedIndex];
    string strValCell = row.Cells[2].Text;
    }

    //and

    public void GridView1_SelectedIndexChanged(Object sender, EventArgs e)
    {

        TextBox1.Text = GridView1.SelectedRow.Cells\[2\].Text; 
    }  
    

    but it doesn't work " any result" and if i do

    public void GridView2_SelectedIndexChanged(Object sender, EventArgs e)
    {
    TextBox tb = GridView1.SelectedRow.FindControl("id0") as TextBox;
    if (tb != null)

         TextBox1.Text = tb.Text;
    
        else
           TextBox1.Text = "no data";
       
    }
    

    I have always "no data"

    ASP.NET tutorial question

  • value of a cell of selected row
    F foryou

    Hi. For a GridView, how to retrieve the cell values of a selected row? Thank you!

    ASP.NET tutorial question

  • GridView and SelectedIndexChanged
    F foryou

    Thank you Satish Mahapatra and Greg Chelstowski. I tried your solution but it does not work:( I want to have: the value of a cell of selected line in a GridView. I read that i can do that :TextBox1.Text = GridView2.SelectedRow.Cells[1].Text; but it doesn't work.

    ASP.NET help

  • GridView and SelectedIndexChanged
    F foryou

    Hi!! public void GridView2_SelectedIndexChanged(Object sender, EventArgs e) { TextBox tb = GridView2.SelectedRow.FindControl("id0") as TextBox; if (tb != null) TextBox1.Text = tb.Text; else TextBox1.Text = "no data"; //TextBox1.Text = GridView2.SelectedRow.Cells[1].Text; } This code returns me always "no data" even if there is data in the GridView. I do not see where is the error. thanks

    ASP.NET help

  • populate GridView with stored procedure
    F foryou

    Thank you Satish Mahapatra it works I forgot a field in my stored procedure.

    ASP.NET database help tutorial

  • populate GridView with stored procedure
    F foryou

    I have no erreur no message erreur if i click sur the button I havent result. my code c#: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; private void Page_Load(object sender, System.EventArgs e) { } public void BindData() { SqlConnection myConnection = new SqlConnection(ConnectionString); SqlCommand myCommand = new SqlCommand("PS_NV2", myConnection); myCommand.CommandType = CommandType.StoredProcedure; SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand); DataSet ds = new DataSet(); myAdapter.Fill(ds, "table"); myConnection.Open(); myCommand.ExecuteNonQuery(); GridView2.DataSource = ds; try { GridView2.DataBind(); } catch { GridView2.PageIndex = 0; GridView2.DataBind(); } myConnection.Close(); } private string ConnectionString { get { string connectionString = (@"Data Source=.\SQLEXPRESS;UID=sa;Password=**3*;Initial Catalog=mybd"); return connectionString; } } protected void GridView2_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { Response.Write(e.NewSelectedIndex); } protected void GridView2_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = GridView2.SelectedRow; TextBox4.Text = row.Cells[2].Text; } protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e) { GridView2.EditIndex = e.NewEditIndex; BindData(); } protected void GridView2_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { GridView2.EditIndex = -1; BindData(); } protected void Button1_Click1(object sender, EventArgs e) { BindData(); GridView2.Visible = true; } } DataKeyNames="c1" OnRowCancelingEdit="GridView2_RowCancelingEdit" OnRowEditing="GridView2_RowEditing" OnSelectedIndexChanged="GridView2_SelectedIndexChan

    ASP.NET database help tutorial

  • populate GridView with stored procedure
    F foryou

    Thank you Satish Mahapatra. it doesn't works :( this code works fine for a datagrid but not for the GridView I do not know if the error can come from here for datagrid i have DataGrid1.CurrentPageIndex = 0; I have replaced by : GridView2.PageIndex =0 ; thanks.

    ASP.NET database help tutorial

  • populate GridView with stored procedure
    F foryou

    HI! I do not know how to populate my GridView with stored procedure I have this code but it doesn't works she returned result or error message

    public void BindData()
    {
    SqlConnection myConnection = new SqlConnection(ConnectionString);

        SqlCommand myCommand = new SqlCommand("PS\_NV2", myConnection);
        myCommand.CommandType = CommandType.StoredProcedure;
        SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
        DataSet ds = new DataSet();
        myAdapter.Fill(ds, "TAble");
        myConnection.Open();
        myCommand.ExecuteNonQuery();
        GridView2.DataSource = ds;
        try
        {
           GridView2.DataBind();
        }
        catch
        {
            GridView2.PageIndex = -1;
            GridView2.DataBind();
        }
        myConnection.Close();
    

    correct me please.Thanks

    ASP.NET database help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups