Click here to Skip to main content
15,914,162 members
Home / Discussions / C#
   

C#

 
Questionhow can i set file or directory that everyone can write Pin
punny20-Jun-06 0:00
punny20-Jun-06 0:00 
QuestionUsing Classes Pin
Ni Na19-Jun-06 23:15
Ni Na19-Jun-06 23:15 
AnswerRe: Using Classes Pin
LongRange.Shooter20-Jun-06 17:05
LongRange.Shooter20-Jun-06 17:05 
QuestionHow to move a toolstrip during runtime? Pin
praveenqwe19-Jun-06 23:10
praveenqwe19-Jun-06 23:10 
QuestionInvalid Token in xpath concat Pin
Duncan Sample19-Jun-06 23:03
Duncan Sample19-Jun-06 23:03 
AnswerRe: Invalid Token in xpath concat Pin
sathish s20-Jun-06 0:51
sathish s20-Jun-06 0:51 
QuestionRe: Invalid Token in xpath concat Pin
Duncan Sample21-Jun-06 4:11
Duncan Sample21-Jun-06 4:11 
QuestionDateTime error [modified] Pin
rah_sin19-Jun-06 22:31
professionalrah_sin19-Jun-06 22:31 
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 

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.