I am creating a custom Label control (by simply Inheriting the standard Label control and re-painting the background and text) because I need a very specific background and border. In the constructor of the control, I set the AutoSize property to false so I can have a standard default size for the new label.
Public Sub New()
/*Se...
I've created another header row for a gridview programmatically. In this row I have a few controls including a label that I want to align all the way to the left of the cell. The one cell has a columnspan of 7 so it runs across the entire gridview. how do i align that label programmatically??
Dim cell As New TableCell
Dim lblfilter ...
If I have a string like:
"26 things"
I want to convert it to 26. I just want the integer at the beginning of the string.
If I was using C, I'd just use the atoi function. But I can't seem to find anything equivalent in .NET.
What's the easiest way to grab the integer from the beginning of a string?
Edit: I'm sorry I was ambiguous...
This has been a pet peeve of mine since I started using .NET but I was curious in case I was missing something. My code snippet won't compile (please forgive the forced nature of the sample) because (according to the compiler) a return statement is missing:
public enum Decision { Yes, No}
public class Test
{
public stri...
Is it possible to navigate entities in Entity Framework as easily as it's done with typed datasets?
With typed-datasets you load many tables from one sproc and then simply use statements like:
//get student’s course
StudentsDS.Course drCourse = drStudent.CoursesRowParent;
// get course students
foreach (StudentsDS.StudentRow dr in d...
Our group will be distributing a .net web site that supports one of our company's products. The end users are companies outside our own, so our group functions as an external IT vendor.
We will be testing and building internally and then delivering an MSI of the final build. I have questions on the best way to deliver a tested product t...
I would like to be able to use a Dataset as an in-memory datastore.
I want to be able to use SELECT, INSERT, UPDATE, and DELETE, CREATE TABLE, DROP TABLE, ALTER TABLE ADD COLUMN, ALTER TABLE DROP COLUMN, and support for Constraints PRIMARY KEY, UNIQUE, NOT NULL, FOREIGN KEY, REFERENCES.
...
When debugging in Visual Studio 2008 I get the error "There is no source code available for the current location" but it does not prompt me to browse for source code. If I click "Show Disasembly" and then right click to select "Go to source code" I get the error "The source code cannot be displayed.
How do I load the source code while ...
Hi,
I want to retrieve the grid view row based on the cell value. For example, I am having a grid view with 4 columns (name,m1,m2,m3) and name contains unique values. So, I want to get the grid view row corresponding to the name specified.
Thanks
...
Hi, I'm starting to use COM+ development due to a necessity on a project, and I started to create a proof of concept based on this just understand how it works.
I could create a simple Component Service with C# by extending System.EnterpriseService.ServicedComponent, and setted its assembly attributes and it worked on a local machine. O...
I have a form with a list that shows information from a database. I want the list to update in real time (or almost real time) every time something changes in the database. These are the three ways I can think of to accomplish this:
Set up a timer on the client to check every few seconds: I know how to do this now, but it would involve...
Imagine an in-house application aimed at the very technical user. The app maintains data. There isn't a heck of a load of data, but there is enough to make some sort of a query mechanism necessary.
The application's UI is very simple. It basically allows the user to enter a query (as text), and shows the data matching that query.
Had t...
Hello, we are using DAAB and TransactionScope on Oracle.
Our application manage all the connection to only 1 database.
This type of implementation it seems to need "Oramts.dll".
Is there a way of using your DAAB and TrasnsactionScope without MTS?
Thanks!
...
I'd like to access some internal classes of the .NET Framework, but using reflection is not very readable, and fun to use.
Does somenone know if a tool exists to generate wrapper classes automatically around these internal classes ?
...
There is a method
Regex.Replace(string source, string pattern, string replacement)
The last parameter supports pattern replacements such as ${groupName} and others (but I don't know the group name in the run-time).
In my case I have the dynamically created pattern like:
(?<c0>word1)|(?<c1>word2)|(?<c2>word3)
My purpose is to repla...
I have a class that currently has several methods that take integer parameters. These integers map to operations that the application can perform. I'd like to make the class generic so that the consumers of the class can provide an enum type that they have with all the operations in it, then the methods will take parameters of that enum ...
This question about Timers for windows services got me thinking:
Say I have (and I do) a windows service thats waiting on a WaitHandle and when woken, it dives into a wait-spin like I have shown below in a flowchart
I'm curious if using a timer would be better than a wait-spin loop (sometimes called a spin-wait). I'll be honest, I'v...
I am doing an archive service for logs. Since some files are open and in use I can't archive them until they are not in use anymore. The only way I can figure out how to see if the file is open by another process is the code below.
I hate the code there must be a better way. Is there a better way?
try
{
using (FileStream stream ...
I've got an issue with nested controls not loading properly. I've tried various page methods and nothing seems to work.
EDIT: The site compiles and runs fine--it just leaves a blank screen though.
Basically I have a wrapper control for a Chart that allows me to select data, bind, and customize the chart with a lot of abstraction. I n...
Hello everyone.
I have some 5+ years' background in C++/Unix development. I have been trying my hand at C#/.Net/WPF based software development for some time now. I am at a stage where I can write functioning applications fluently, but am not sure how to take my skills to the next level.
So, my question(s) to you all, especially to thos...