Does anyone have a suggestions as to the best way to allow users to select which columns appear in a datagrid? I would like them to be able to set this up. It would be stored with the user in a profile and loaded each time the user loads the grid. I was thinking about something with ASP.NET personalization.
...
So if I have:
public class ChildClass : BaseClass
{
public new virtual string TempProperty { get; set; }
}
public class BaseClass
{
public virtual string TempProperty { get; set; }
}
How can I use reflection to see that ChildClass is hiding the Base implementation of TempProperty?
I'd like the answer to be agnostic between c...
I am using VB9's inline XML, and I have a need to specify a non-breaking space. Where you would normally use " " in html, using it in inline XML produces the "XML entity references are not supported" error. How do you specify a non-breaking space?
...
I have the following structure:
<StructLayout(LayoutKind.Sequential)> _
Public Structure _WTS_CLIENT_ADDRESS
Public AddressFamily As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)> _
Public Address() As Byte
End Structure
Which is populated by the following call:
Dim _ClientIPA...
In OOP languages like C# or VB.NET, if I make the properties or functions in a super class protected I can't access then in my Form, They can only be access in my class that inherits from that super class.
To access those properties or functions I need to make them public which defeats encapsulation on re-write them in my class which de...
Why must Type.Equals(t1, t2) be used to determine equivalent types, and not the equality operator (e.g. for VB.NET, t1 = t2)?
It seems inconsistent with other parts of the .NET API.
Example in VB.NET:
If GetType(String) = GetType(String) Then
Debug.Print("The same, of course")
End If
causes a compile-time error of "Operator '=...
Hi,
I have some content that i have to render as a excel file in browser. I was able to render a grid content to excel with the below code.
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.xls";
System.IO.StringWrite...
Similar to this question, but for VB.NET since I learned this is a language thing.
For instance, would the compiler know to translate
Dim s As String = "test " + "this " +
"function"
to
Dim s As String = "test this function"
and thus avoid the performance hit with the string concatenation?
...
What is the easiest way to set the contents of an <asp:ContentPlaceHolder> programatically? I imagine ill have to do a Master.FindControl call?
...
I am looking for the VB.NET equivalent of
var strings = new string[] {"abc", "def", "ghi"};
...
I'm trying to inject a dynamic where clause in my Linq to SQL query and I get an overload exception. The same expression work when added in the query proper?
qry.Where(Function(c) c.CallDate < Date.Now.AddDays(-1))
Any thoughts on how to this to work?
The exception reads:
Overload resolution failed because no accessible 'Where' ca...
I am having some problems with events being raised from the non-UI thread, in that i dont wish to have to handle the If me.invokerequired on every event handler added to the thread in Form1.
I am sure i have read somewhere how to use a delegate event (on SO) but i am unable to find it.
Public Class Form1
Private WithEvents _to As ...
In the early days of .Net, I believe there was an attribute you could decorate a class with to specify a default property.
According to some articles I've found, this appears to have been yanked from the framework at some point because it was a little confusing, and I can see how that is the case.
Still, is there another way to get th...
I have moved from C# to 9-5pm VB.NET
Any tricks i should know? Where does VB.NET differ the most apart from syntax?
Where have namespaces gone?
[Note: just found http://converter.telerik.com/ brilliant]
Cheers
John
...
Hi,
i need a Regular Expression to convert a a string to a link.i wrote something but it doesnt work in asp.net.i couldnt solve and i am new in Regular Expression.This function converts (bkz: string) to (bkz: show.aspx?td=string)
Dim pattern As String = "<bkz[a-z0-9$-$&-&.-.ö-öı-ış-şç-çğ-ğü-ü\s]+)>"
Dim regex As New Regex(pattern...
In designing a class for customer for example would it make sense to use an Enum for CustomerType?
...
I was just wondering if there is any difference between the two different new object initializers or is it just syntactic sugar.
So is:
Dim _StreamReader as New Streamreader(mystream)
and different to:
Dim _StreamReader as Streamreader = new streamreader(mystream)
Is there any difference under the hood? or are they both the sam...
Where can I find either literature or video demonstration of unit testing applications using VB.NET? As a novice/hobbyist programmer I would like to build a solid foundation in developing applications using the unit testing methodology.
...
Is this the best way to handle file moving in a windows service? we have many files that get matched and moved, but an end user may have the file opened at the time of moving.
This is what the code currently says:
Do While IO.File.Exists(OriginalFilePath)
Try
IO.File.Move(OriginalFilePath, BestMatchPath)
Catch ex As IO.IO...
This function appears to be a way to access all sorts of system values. For example
nativemethods.GetSystemMetrics(4096) returns whether a session is remote or local. All I can find on the web are specific examples--does anyone know where I could find a complete list of input parameter values/what they return? Seems that it could be v...