Jump to content
Xtreme .Net Talk

Shurikn

Avatar/Signature
  • Posts

    62
  • Joined

  • Last visited

Everything posted by Shurikn

  1. oki have this: requeteSql="SELECT Sum(CréditsDeVente) AS SumEnCours "+ "FROM tblProjet, tblIndividus "+ "WHERE statut=\"En cours\" "+ "AND tblProjet.ProjetIndividu=tblIndividus.NomPrénom "+ "AND tblIndividus.IndividuChargéDeCompte="+userId; the query is working in acess but it's not giving anything in asp.net is the SUm not working or something? if you need more details, please ask. ill check in aboiut an hour, then tomorow morning
  2. requeteSql="SELECT index FROM tblUser WHERE ((Nom + \", \" + Prenom)=\""+drpRessource.SelectedItem.Text+"\") AND (groups LIKE \"%"+group+"%\")"; maCommande = new OleDbCommand(requeteSql, maConnexion); monLecteurDeDonnees = maCommande.ExecuteReader(); ressource=Convert.ToString(monLecteurDeDonnees["index"]); the query gives: "SELECT index FROM tblUser WHERE ((Nom + ", " + Prenom)="Cola, Pepsi") AND (groups LIKE "%35%")" i've tryed the same thing in acess changing the '%' to '*' (i dont know why they dont use same wildcars ....) and im geting a result, but when i do it from asp.net, it gives me an error saying: "no data for the line/row" is there anything obvious im forgetting or is this an error elsewhere in my code (I wouldnt see why since my code is about the same everywhere and this is the only request not working) by the way... in my DB there is a guy named Cola, Pepsi, and he's in group G35 is index is 75.
  3. do you just want to open it in a new window? it would be very simple to do... but you must mean something else?
  4. ok... i have a simple query... really simple string sql="UPDATE tblParametre SET image=\"" + nomFichier[nomFichier.Length-1] +"\"" ; SQL.ExecuteNonQuery(sql); wich gives: "UPDATE tblParametre SET image="goutte.JPG"" the name of the pic is only a string... the UPDATE works well if i put it directly in access, but from my code it just wont work the SQL.ExecuteNonQuery comes directly from msdn public static void ExecuteNonQuery(string sql) { OleDbConnection conn = null; try { conn = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source=" + HttpContext.Current.Server.MapPath("rootInextenso.mdb")); conn.Open(); OleDbCommand cmd = new OleDbCommand(sql, conn); cmd.ExecuteNonQuery(); } // catch (Exception e) // { // Response.Write(e.Message); // Response.End(); // } finally { if (conn != null) conn.Close(); } } i really cant see what's wrog with this code... im getting an: Syntax error in the UPDATE statement... wich does not make sense... i tryed to chang the " " " to " ' " i tryed to put a where anything not like something (just to say i had a where... even if it's uselless cuz i dont want any since i want it to apply to the whole table) ... not working
  5. after the update in the DB i use this: Response.Write("<script>window.open(\"groups.aspx?UserId="+Request.QueryString.Get("UserId")+"\",\"main\");</script>"); but i forced IE to release the cache(firefox was not doing this) and now it's working, i fond my answer there: http://www.xtremedotnettalk.com/showthread.php?t=84805
  6. heres my porobleme, i have a page with an asp:table that is loaded at page load, the table contains data from a database... it works well, but if i add a member then come back to that page (by a link to come back, not the 'back' button) the table wont load, the last table loaded stays there, so i cant see the memeber i just added... I noticed it wont do the page lkoad event... i dont know what hapened since it's the 5th page of this kind i have in my project and all the others works fine, and i didnt do anything diferently than from the others... anyone might klnow what's going on?
  7. hello I'm haveing a stupid problem with checkbox/radio button, I am creating a whole page from code behind, the page is is actually displaying a database, and on every row, the first collon is a check box, but since the row is created in code-behind, so is the checkbox, and I am unable to acess this comtrol after... So In the header i put a check box to chek all the other check box under them (like in hotmail) but it just wont work since it does not see the other check boxes... herse my check box code: private void chkAll_ServerClick(object sender, System.EventArgs e) { if(chkAll.Checked) { foreach (Control objC in Page.Controls) { Type objType = objC.GetType(); if (objType.FullName == "System.Web.UI.HtmlControls.HtmlForm") { HtmlForm objF = (HtmlForm) objC; foreach (Control objWC in objF.Controls) { Type objWCType = objWC.GetType(); if (objWCType.FullName == "System.Web.UI.HtmlControls.HtmlInputCheckBox") { CheckBox objCB = (CheckBox) objWC; objCB.Checked = true; } } } } } else { foreach (Control objC in Page.Controls) { Type objType = objC.GetType(); if (objType.FullName == "System.Web.UI.HtmlControls.HtmlForm") { HtmlForm objF = (HtmlForm) objC; foreach (Control objWC in objF.Controls) { Type objWCType = objWC.GetType(); if (objWCType.FullName == "System.Web.UI.HtmlControls.HtmlInputCheckBox") { CheckBox objCB = (CheckBox) objWC; objCB.Checked = false; } } } } } } I am having the same problem in another page, the other page is a page that controls acess to a certain folders, you can chose groups or members and add thgem to the list then set them rights... i wanted to do this with check boxes, (CHMOD style) 9 check boxes for each group/member 3 columns, 3 row, row1= view, row2=download, row3= upload/delete column1= own, colum2= group, column3 = all once again... same problem, if i want to add a group/member i have to do it trough code... and once again I will not be able to chek the status of my checkboxes. please help!!!
  8. i've searched the forum for this, but i only fond how to do the message box, not how to retrieve what button the user pressed... i have an upload button and what i wont to do is if the user try to upload a file that is already there, it ask them if they want to overwrite it. right now it just overwrite it without asking... and is it's possible, if someonme can give me the code in c# code-behind i'd apreaciate ^^
  9. From msdn: that seemed to be the problem ^^
  10. I didnt know exactly where to post this... asp.net or database?... anyway: im new to asp.net (new to web programing) and yesterday i finally connected to my db (yay!) i was able to do a simple SELECT query... but after that, i tryed to do an INSERT and it didnt work, i keep geting a message that tells me: [OleDbException (0x80004005): L'opération doit utiliser une requête qui peut être mise à jour.] wich means: the operation need to use a query that can be updated (or something like that) i copied a code sample from asp101.com and tryed to execute it and i got the same error... so i dont really understand what the problem is... if anyone can help, or just help me find a GOOD ASP.net forum i would apreaciate, Thanks
  11. ok, i'm new to web programing, i tryed php, now im trying asp. I know c# but i dont know how to use DB in c#. What im asking, is how do I conect to a MySQL db using ASP (c#).... thanks
×
×
  • Create New...