vb.net

How do I encrypt a string in vb.net using RijndaelManaged, and using PKCS5 padding?

I use the following code to initialize encryption... Dim symmetricKey As New System.Security.Cryptography.RijndaelManaged() With symmetricKey .Key = Encoding.ASCII.GetBytes(Key) .IV = Encoding.ASCII.GetBytes(IV) .Mode = CipherMode.CBC .BlockSize = 128 .KeySize = 128 .Padding = PaddingMode.PKCS7 End With The requi...

Entity Framework How to query data in a Navigation property table

I have a the following setup m_handsets = From p In RL.App.TComEntities.tblTelephoneNumbers _ Where p.companyId = m_CompanyID _ Select p m_handsets = DirectCast(m_handsets, ObjectQuery(Of RL.TelephoneNumbers)).Include("tblCalls") where m_ha...

Deleting bound item from DataGridView

I have a List of an object, set to DataSource of a BindingSource, set to DataSource of a DataGridView. Then I added a DataGridViewButtonColumn which I want a click to remove that record from the collection. So I simply call collection.RemoveAt(e.rowIndex) from the DataGridView CellClick event. However this produces an IndexOutOfRange Exc...

VB.Net Clear or Reset form BackColor?

Hey guys! A simple question, but simple part of learning. How do I clear/reset the BackColor of a windows application form? For instance, I have a set of radio buttons, each one changes the color of the background form color, when i reset the radio buttons i would also like to reset the color of the form back to it's original sta...

LINQ: Select from IEnumerable with Distinct/GroupBy and sorting - possible?

My particular example is fairly complex but I think the concept would apply equally to something like a logging system so I'll use that instead for ease of explanation. It's a ficticious example, please don't harp on or agonise over what is achitectually, programatically or morally wrong with the example itself :) Say you have this: cl...

Calling .FindByType makes VB6 error out, help?

Possible Duplicate: Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic. Basically, im just searchign for uPnP devices using the uPNPDeviceFinder classes .FindByType method, .FindByUDN works, but FindByType gives an error: VB6 gives a compile error when I attempt t...

Is String a primitive type?

I am curious about the string and primitive types. Article like this says string is primitive type. However second article on MSDN does not list string as primitive type. However when I ran the code provided in second article, it displays String is not Primitive type. Can any one guide me on this? Thanks, Ram ...

Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic.

What does this error mean in VB6? Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic. I keep getting it when i call a particular method of a dll that comes with windows xp and beyond (in system32 called upnp.dll) Anyone any ideas? google wasn't helpful ...

Simple Question, how to I create a dynamic CSV - ASP.NET, VB

Howdy, Now I'm a complete newby to .Net and the likes of VB (I'm more of a Ruby/Rails, PHP kinda guy). Anyway I currently have a sub that has a string builder that I'm wish to use as the content of a CSV which I will email later from a webpage. My stringbuilder is creating the content for the CSV but I don't know how to create the CSV ...

Call a form sub from another form

I have a form Friend Class frmOrganigramma Inherits System.Windows.Forms.Form with a sub Sub OutList() How can i launch this sub from another form? Thanks ...

to rewrite url in Global.asax, ASP.NET

HEllo. I need replace double slashes in one slash. I am planning do this in Global.asax Application_BeginRequest event. Is it enough? or better do a http module? Thank you. UPD Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) ' Fires at the beginning of each request Thread.CurrentThread.CurrentCul...

Linq to DataTable not producing Distinct values

Hi, I have a datatable which has been dynamically generated from FoxPro tables using a UNION Select statement. e.g. SELECT * FROM x UNION SELECT * FROM y UNION SELECT * FROM Z ORDER By v_alue1 This produces a datatable with about 100 rows, each containing many fields, one of which is c_olor. From this datatable, I would like to selec...

What is the VB .Net equivalent of the C# shortcut test for something to be true or false?

Possible Duplicate: Is there a conditional ternary operator in VB.NET? C# has a shortcut like this: cmd.Parameters.Add(new SqlParameter("@p2", ((supplierID > 0) ? (object)supplierID : DBNull.Value))); Just curious if VB .Net has something like that too? ...

Deserialize a Digital Persona template in VB.net

Reading binary data out of the database, and I need to convert it back into a Digital Persona fingerprint template. I'm not familiar with serialization and deserialization, so I could use a bit of help. Here's what I tried: Dim rsBioData As SqlDataReader = SQL.ExecuteReader Dim byteTemplate As Byte Dim memStreamTemplate As MemoryStrea...

Close all forms in vb

How can i close all forms I use wpf vb 2010 To load other form i use like Private frm As MainWindow = New MainWindow to open the window i used frm.Show() and to close it i use frm.Close() Now I have two forms like form1 and form2 I want to open form2 when i click on the button - ok it's easy The Question How can i closed fo...

what is the difference in vb.net web apps and c# .net webapps

hello, can any one tell me the difference between vb.net web apps and c# .net webapps y most of the apps are done in c# rather than vb.net ...

How to first use javascript to validate form data before triggering onServerClick for HTML Input button?

So right now it all looks pretty with ... <button type="submit" runat="server" name="subscribe" id="Button1" class="link-button" onserverclick="saveListing"> Until it is time to validate the data before calling saveListing function codebehind (in VB .Net). How can true/false be return so that when true saveListing will be called, oth...

Overrides a "list of base class" property and returning a "list of child class"

Hello, I have a base class (ex: Class1) containing a list of another base class (ex: ClassA). Each child class of first base class (ex: Class1AA, Class1AB,..) containing a list of child class of second base class (ex: ClassAA, ClassAB,...) The client must never know which child class is using, then i don't think i can use generic for m...

.Net Rounding Issue

Hello everyone. I have a rounding issue inside of .Net. I am rounding a 3 digit number down to two digits and it is causing some problems with one number. If I try to round 34.425 to two decimal places it should round it to 34.43. I am using the roundawayfromzero option and it has worked for every number in the program except for thi...

Vb.net click link by looking for String!

Hello, I am working on a vb.net program, I want to click a hyperlink on a page, the source look like this: <a href="user_messages_view.php?id=23112">messages for Today, 2010-10-19 </a> I want to check it everyday too! I tried to click it with the following methods(Both couldn't click the link!): Dim theElementCollection As HtmlEleme...