needs_upgrade Posted July 29, 2008 Share Posted July 29, 2008 Hello guys! I just wanted to know what are the advantages of VB.net over VB and/or vice versa.... Another question: if in php we can do this: <PHP? $sql = "SELECT product_id, product_name, product_description FROM products ORDER BY product_name"; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)) { print "<tr> <td><a href='product.php?product_id=$row[0]'>$row[1]</a></td> <td>$row[2]</td> </tr>"; } ?> how can i do it with vb/vb.net? i've heard that i can use the datagrid. but i dont know how to do it. thnx for any help guys. more power to you all. Quote Link to comment https://forums.phpfreaks.com/topic/117185-vb-vs-vbnet/ Share on other sites More sharing options...
corbin Posted July 29, 2008 Share Posted July 29, 2008 Uh isn't Visual Basic.NET just Visual Basic with the .NET framework? So, it would go something like this: VB: -No dependency on .NET framework (certain versions, having to have it at all, so on) VB.NET: -Uhhh to be honest, I've never used the .NET framework, but being a framework, I would assume it has code already written and what not. Uhmmm I've connected to MySQL through C++ and Java before, but I've never coded a single thing in Visual Basic (that's right -- I'm making all this up as I go ;p). Anyway, I Googled, and this should get you started: http://www.base64.co.uk/mysql-odbc-driver/ http://www.vbmysql.com/articles/vbnet-mysql http://www.mysql.com/products/connector/odbc/ Bleh, just google "Visual Basic MySQL" Quote Link to comment https://forums.phpfreaks.com/topic/117185-vb-vs-vbnet/#findComment-602861 Share on other sites More sharing options...
FVxSF Posted August 25, 2008 Share Posted August 25, 2008 I'd say VB is old...er school. I was working with it back in 2001-ish. The nice thing about .net is that it's all managed. But the down side is that you don't get the control like you would in C/C++ Me, I like to program in VB .net because I know just about all Vista and XP SP3 machines should be able to run the program. I'd like to learn C\C++ but my college doesn't offer it (well the only one I can afford) and I cannt find a good solid starting point on the web, which is where I learn best. As for your php code, are you wanting to dump it into a Data Grid, Listview, Listbox? There is a good video series on databases. The guy is boring but he makes things easy to under stand. Here's the links to the vidoes: Look for "Forms over Data Video Series" http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx With the ADO.NET connector you can even access mysql databases. Nice if you want a Web/Windows type app http://dev.mysql.com/downloads/connector/net/1.0.html Quote Link to comment https://forums.phpfreaks.com/topic/117185-vb-vs-vbnet/#findComment-625218 Share on other sites More sharing options...
captbeagle Posted July 24, 2009 Share Posted July 24, 2009 .NET does allow use of C/C++ libraries though. Take a look at the interop assembly functions. The platform is also useful since it allows compatibility between applications written in VC++, VC#, VJ# and all their other languages. Quote Link to comment https://forums.phpfreaks.com/topic/117185-vb-vs-vbnet/#findComment-882311 Share on other sites More sharing options...
KevinM1 Posted July 24, 2009 Share Posted July 24, 2009 My .NET isn't very good, since I'm still learning it, but to emulate typical PHP firehose behavior, you simply need a command object and a data reader. Here's some of my code. It's C#, but it should give you an idea of what to do: string query = "Select level, name, tpCost, dmgModifier, hitPenalty from DBHackerAttacks"; using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["GitSConnectionString1"].ConnectionString)) { SqlCommand cmd; SqlDataReader reader; cmd = new SqlCommand(query, conn); conn.Open(); reader = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (reader.Read()) { HackerAttack hackerAttack = new HackerAttack(reader.GetInt32(0), reader.GetString(1), reader.GetInt32(2), reader.GetDouble(3), reader.GetDouble(4)); this.attacks.Add(hackerAttack.Level, hackerAttack); } } This is .NET 3.5, so some of the things may need to be tweaked. It uses ADO.NET, so you'll need to ensure the proper namespaces are included. With your example, you could either dynamically build a table/other structure, and fill in its cells in the while-loop, or you could pre-make the table/other structure in the plain .aspx file, and, once again, fill its cells with data in the loop. Quote Link to comment https://forums.phpfreaks.com/topic/117185-vb-vs-vbnet/#findComment-882329 Share on other sites More sharing options...
needs_upgrade Posted August 1, 2009 Author Share Posted August 1, 2009 Thanks so much guys. Quote Link to comment https://forums.phpfreaks.com/topic/117185-vb-vs-vbnet/#findComment-888230 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.