what is the regex to replace only the last comma, using preg_replace? Thanks
mabrahao
Posts
-
how to preg_replace the last comma? -
string formateYou should replace commas to spaces and String.Format is uppercase in the S
-
instantiating a generic object [modified]Thanks a lot, it was missing "Test,"
-
instantiating a generic object [modified]but the T class is a non-abstract and has no constructor parameter
-
instantiating a generic object [modified]i got this msg: Error 800 'T' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method
-
instantiating a generic object [modified]Hi guys, i have a method like this: public List listObj() {} and i want to instantiate a object with this type T, i tried this: T obj = new T(); doesnt work, so i tried T obj = default(T); and doesnt work too... how can i instantiete this obj??? Thanks. The code: public class MysqlDireto { private static MysqlDireto _instancia; private static string connectionstring = "Server=;Database=;Uid=;Pwd=;"; public static MysqlDireto Instancia { get { return _instancia ?? (_instancia = new MysqlDireto()); } } public List<T> ObterLista<T>() { MySqlConnection conn = new MySqlConnection(connectionstring); string comando = "SELECT * FROM " + typeof(T).Name; MySqlCommand cmd = new MySqlCommand(comando, conn); conn.Open(); MySqlDataReader leitor = cmd.ExecuteReader(); List<T> lista = new List<T>(); if (leitor.HasRows) { while (leitor.Read()) { T obj = Foo<T>(); obj.GetType().GetProperty("Id").SetValue(obj, leitor["Id"], null); lista.Add(obj); } } conn.Close(); return lista; } public T Foo<T>() where T : class, new() { return new T(); } }
modified on Wednesday, June 8, 2011 2:11 PM
-
get real html code from webbrowserI think it exists, firebug shows the final HTML, but ok... i will look for DOM. Thanks anyway!! Marcus.
-
get real html code from webbrowserThanks, but webbrowser1.DocumentText doesnt work, it gets: <html> <body> Document.write("Text"); </body> </html> =/ i dont know what to do anymore.
-
get real html code from webbrowserHi, how can i get the real html code in a webbrowser object??? a mean, if the page has the following code: Document.write("Text"); i wanna get the code after the js runs. what i want is to get this: Text thanks, Marcus.
-
using npgsqlHi, i am making an app and im using postgre, so im making my connection with npgsql, but i need to make a report and im trying to use crystalreport, but i have no idea how to use crystal + npgsql. Can anyone help me please? thanks a lot
-
call an opener form methodsolved... just removed the : this(). anyway... thank you very much
-
call an opener form methodok, almost there... i got only one more problem... i need to pass 2 param to my form2. ex: From2 form = new Form2(id, this);
-
call an opener form methodi've used From2 f = new Form2(ref Form1 this); but didnt work.
-
call an opener form methodhi guys, i have a form that needs to call a function on his opener form. How can i do this? ex: form1 opens form2, and form2 needs to call a method in form1. thanks a lot!
-
desable a menustrip itemok, thank you very much!!! it was a very good answer
-
desable a menustrip itemthank you vary much... works great!!!
-
desable a menustrip itembut how? thanks
-
desable a menustrip itemhi guys, i'm looking for all over the internet i a just cant find it, i am almost giving up... So, how can i desable a menustrip item from another form. ex: i have a form1(mdi) and i open inside it a form2, and from this form2, i wanna desable a form1 menustrip item. thanks sorry for the bad english.
-
begintrans, commit and rollbackhi, im doing a app on vb6 and i have a doubt about the transaction. how can i know if the transaction is "open" or not. thanks, Marcus
-
change .net frameworkOk, thank you anyway, i will try again here... hugs