Click here to Skip to main content
15,900,706 members
Home / Discussions / C#
   

C#

 
AnswerRe: DateTime error Pin
sathish s20-Jun-06 0:02
sathish s20-Jun-06 0:02 
AnswerRe: DateTime error Pin
LongRange.Shooter20-Jun-06 17:15
LongRange.Shooter20-Jun-06 17:15 
GeneralRe: DateTime error Pin
rah_sin20-Jun-06 18:32
professionalrah_sin20-Jun-06 18:32 
GeneralRe: DateTime error Pin
LongRange.Shooter22-Jun-06 0:46
LongRange.Shooter22-Jun-06 0:46 
QuestionUsing Date last modified? Pin
kbalias19-Jun-06 21:55
kbalias19-Jun-06 21:55 
AnswerRe: Using Date last modified? Pin
Stefan Troschuetz19-Jun-06 22:02
Stefan Troschuetz19-Jun-06 22:02 
GeneralRe: Using Date last modified? Pin
kbalias19-Jun-06 22:07
kbalias19-Jun-06 22:07 
QuestionVS 2005 Windows Forms Designer Error when dragging UserControl Onto Form Pin
supD19-Jun-06 21:39
supD19-Jun-06 21:39 
I created a form that uses Enterprise Library - DAAB - version Jan 2006 to access the DB in its constructor. Everything works fine; however, when I created a UserControl that attempts to access that form, the VS 2005 designer will not let me drag that UserControl onto a new form. It gives me the following error:


“Failed to create component ‘UserControl’. The error message follows: ‘System.NullReferenceException: Object reference not set to an instance of object. At Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.get_DefaultName(), at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseMapper.MapName(String name, IConfigurationSource configSource)……."


Everything compiles and runs successfully without errors; however, I am unable to use the UserControl on any forms. After debugging, I found that the error is caused by the line “Database db = DatabaseFactory.CreateDatabase();” called by the form that the UserControl contains.


I feel that being able to store forms (w/ DB access) inside UserControls is a reasonable requirement. Any help would be appreciated! Thanks in advance!


Below is the relevant code:


public partial class SampleControl : UserControl
{
private ProductForm subForm = new ProductForm();

public SampleControl ()
{
InitializeComponent();
}
}

public partial class ProductForm : Form
{
public ProductForm()
{
InitializeComponent();
AccessDB();
}

private void AccessDB()
{
//THIS LINE CAUSES THE DESIGNER ERROR
Database db = DatabaseFactory.CreateDatabase();
}
}


thanks
Questionkeep control then focus on it Pin
freshonlineMax19-Jun-06 21:37
freshonlineMax19-Jun-06 21:37 
AnswerRe: keep control then focus on it Pin
Mairaaj Khan19-Jun-06 22:17
professionalMairaaj Khan19-Jun-06 22:17 
QuestionDetermining non-persistent properties Pin
kumar.bs19-Jun-06 21:32
kumar.bs19-Jun-06 21:32 
AnswerRe: Determining non-persistent properties Pin
LongRange.Shooter20-Jun-06 17:18
LongRange.Shooter20-Jun-06 17:18 
QuestionAdding user dockable window in c# Pin
praveenqwe19-Jun-06 21:25
praveenqwe19-Jun-06 21:25 
QuestionHelp me for adding Style Sheet to the Project Pin
Jack_00719-Jun-06 21:02
Jack_00719-Jun-06 21:02 
AnswerRe: Help me for adding Style Sheet to the Project Pin
Stefan Troschuetz19-Jun-06 21:57
Stefan Troschuetz19-Jun-06 21:57 
QuestionC# Pin
balwan_jpr19-Jun-06 20:56
balwan_jpr19-Jun-06 20:56 
AnswerRe: C# Pin
J4amieC19-Jun-06 21:51
J4amieC19-Jun-06 21:51 
Questionhow to delete entries in HKLM of windows registry(regedit) in inno scripting lang. Pin
YogeshRT19-Jun-06 20:48
YogeshRT19-Jun-06 20:48 
Questionjavascript prompt window in C# web forms [modified] Pin
mecrazycode19-Jun-06 20:40
mecrazycode19-Jun-06 20:40 
QuestionChanging file names? Pin
kbalias19-Jun-06 20:30
kbalias19-Jun-06 20:30 
AnswerRe: Changing file names? Pin
Stefan Troschuetz19-Jun-06 21:13
Stefan Troschuetz19-Jun-06 21:13 
AnswerRe: Changing file names? Pin
Vega0219-Jun-06 21:15
Vega0219-Jun-06 21:15 
GeneralRe: Changing file names? Pin
kbalias19-Jun-06 21:24
kbalias19-Jun-06 21:24 
QuestionDevice Driver Pin
alaquniabi19-Jun-06 20:25
alaquniabi19-Jun-06 20:25 
QuestionPrinting an Image scaled to full page Pin
STRICQ19-Jun-06 19:05
STRICQ19-Jun-06 19:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.