Hi,
Would it be theoretically possible to make BackgroundWorker in a class to periodically refresh existing splash screen form, or is that impossible? (I know that it's probably bad design, but currently I do not see any better way.)
Please keep in mind that:
I do not want the background worker to do the loading as it would be terrib...
So I am looking at creating a generic Interface to interact with my DataStorage of my objects one that I can swap out to use EF4 or SubSonic or NHibernate or some NoSQL option.
So I have an ERD and every table has an auto incrementing int column "TableNameID" that is the primary key I am trying to figure out how to get a single record...
I am currently working on a project where we have a couple very control heavy user controls that are being used inside a MDI Controller. This is a Line of Business app and it is very data driven.
The problem that we were facing was the aforementioned controls would load very very slowly, we dipped our toes into the waters of multi-threa...
In C# I can test for this...
public event EventHandler Trigger;
protected void OnTrigger(EventArgs e)
{
if (Trigger != null)
Trigger(this, e);
}
Is there a way to do this in VB.NET? Test for null I mean?
MORE INFO
I forgot to mention. I have classes written in C# but I am writing my unit tests in VB.NET.
I am tryin...
I am writing a app in .NET which will generate random text based on some input. So if I have text like "I love your {lovely|nice|great} dress" I want to choose randomly from lovely/nice/great and use that in text. Any suggestions in C# or VB.NET are welcome.
...
I'm trying to create a .resx file from a dictionary of strings. Luckily the .Net framework has a ResXResourceWriter class. The only problem is that when I create the file using the code below, the last few lines of my generated resx file are missing. I checked my Dictionary and it contains all the string pairs that I expect.
public v...
I'm currently working on an emulation server for a flash-client based game, which has a "pets system", and I was wondering if there was a simpler way of going about checking the level of specified pets.
Current code:
public int Level
{
get
{
if (Expirience > 100) // Level 2
{
if (Expirience > 200) //...
I am beginning to think I am doing something wrong. I mean they did place System.String.IsNullOrWhitespace finally but no ArgumentEmptyException class.
public FilterItem(string name, IEnumerable<string> extensions)
{
if (string.IsNullOrWhiteSpace(name))
{
throw new ArgumentNullExce...
I am cleaning up some code in a C# app that I wrote and really trying to focus on best practices and coding style. As such, I am running my assembly through FXCop and trying to research each message it gives me to decide what should and shouldn't be changed. What I am currently focusing on are locale settings. For instance, the two error...
Hey Guys
I'd like to update an entity via linq, but since I edit the entity in a view after serializing it, I don't have direct access to the entity inside the data context. I could do it like this:
entity.property1 = obj.property1;
entity.property2 = obj.property2;
...
thats not cool... not cool at all.
Next thing I tried is to do ...
i try to write a winform application:
i dislike below codes:
DataTable dt = new DataTable();
dt.Load(dr);
ds = new DataSet();
ds.Tables.Add(dt);
Above part of codes looks unsufficient.How can i best loading dataset?
public class LoadDataset
{
public DataSet GetAllData(st...
I have been using my website (ASP.NET MVC) in visual studio but now I want to host it on my server. I published from visual studio onto the network share to be used. The server is running Windows Home Server, IIS 6 and SQL Server 2008 R2 (express).
In Microsoft SQL Server Management Studio, I've attached the database and made sure that ...
Lets say you have a DataTable that has columns of "id", "cost", "qty":
DataTable dt = new DataTable();
dt.Columns.Add("id", typeof(int));
dt.Columns.Add("cost", typeof(double));
dt.Columns.Add("qty", typeof(int));
And it's keyed on "id":
dt.PrimaryKey = new DataColumn[1] { dt.Columns["id"] };
Now what we are interested in is the co...
Hey All,
I've got a winforms .net 2.0 application that's hitting a MS SQL 2008 server. I load up a DataSet from that server, expose a bunch of that dataset via bound winform controls & then push updates via SqlDataAdapters.
One such adapter is attached to a table w/two key fields RecruitID and StatusDate. StatusDate is a DateTime fie...
Hi there,
I'd like to somehow hook into the local system's network stack to capture outgoing network packets without using Winpcap. Unfortunately it tends to crash my system every now and then.
Is there a way to "sniff" outgoing traffic of the local system from a user space process written in a .NET language?
Thanks a lot!
Hendrik
...
I'm not sure if this is doable, but I will just give a shot.
I am calling Assert.AreEqual() method.
For the parameters, I'm passing...
an enum value which has Int32 as the underlying type because I didn't specify the base type
an int (Int32) value
Assert fails because it sees that the enum is not int (which is definitely correct).
H...
Here is a peace of code:
void MyFunc(List<MyObj> objects)
{
MyFunc1(objects);
foreach( MyObj obj in objects.Where(obj1=>obj1.Good))
{
// Do Action With Good Object
}
}
void MyFunc1(List<MyObj> objects)
{
int iGoodCount = objects.Where(obj1=>obj1.Good).Count();
BeHappy(iGoodCount);
// do other stuff with 'objects' co...
If I have a fairly crud-based area of my app, do I really have to create separate "Create" and "Edit" views? The HTML will be practically the same. I want an "Edit" and "Create" action to both render a "Show.aspx" view, but certainly Resharper 5 is complaining about there being no "Show" action.
What's the best practice?
...
When I am concatenating object values together to form a string in VB.NET, is there a difference in performance or a recommended best practice between using the & concat or the + concat with calls to .ToString() on each object?
Example (which is faster or best practice):
Dim result1 As String = 10 & "em"
Dim result2 As String = 10.ToSt...
Hi,
I have a clickonce application (VS2010, .NET 4). I have registered a file association (.task), and this all works well. If I double click a file with the .task extension on the desktop the clickonce application opens and can open the file.
If I email the file however, and double click the file from within outlook, I get the open/sa...