|
|
Nevermind, my custom control was broken...
Windows Calculator told me I will die at 28.
|
|
|
|
|
hi,
i want to know how a universal conection can be built so that my programe with a small dataBase
file can be opened on the others pcs as well without giving a new connection string.giving connection string at every other pc ,i want to avoid this.
|
|
|
|
|
You need the physical address of the database file to open the connection, but if you place the database file at the same relative position to the executable all the time, you can create the path by getting the path of the executable and add the relative path to the database.
---
Year happy = new Year(2007);
|
|
|
|
|
here is my app.config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<dataConfiguration defaultDatabase="SqlConnection" />
<connectionStrings>
<add name="SqlConnection" connectionString="server=Developer;database=MSPetShop;Integrated Security=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
first i m getting these two errors:
Message 1 Could not find schema information for the element 'dataConfiguration'.
Message 2 Could not find schema information for the attribute 'defaultDatabase'.
and when i try to call the from my DAL layer i got exception
i m using this funcion
Database db=DatabaseFactory.CreateDatabase();
I hope any one there will reply me many thanks,
adnan
|
|
|
|
|
Hi,
Please make sure that the assembly and the project name specified in the configSections of the app.config is same as what you have in your project.
Thanks
Rakheesh
|
|
|
|
|
Why in .NET 2.0 framework an instruction as under brought back SHOW the millisecond and in framework .NET 2.0 CF (same function, identical code) the millisecond do not SHOW? I have tried also with the Application.DoEvents but nothing ... why?
Es..
private long m_lInitialTick;
private void StartCrono()
{
m_lInitialTick = DateTime.Now.Ticks;
timerTmp.Interval = 1;
timerTmp.Enabled = true;
}
private void StopCrono()
{
timerTmp.Enabled = false;
}
private void timerTmp_Tick(object sender, EventArgs e)
{
label.Text = Convert.ToString((DateTime.Now.Ticks - m_lInitialTick) / 10000) ;
}
|
|
|
|
|
What is the timerTmp that you are using? Is it a timer control?
You are using an awfully short interval. If you update the label a thousand times a second, you are updating it somewhere between ten and twenty times as often as the screen is able to show it.
How do you call the code? If the main thread is busy after you have started the timer, it won't handle the tick events.
---
Year happy = new Year(2007);
|
|
|
|
|
You are both up for a big disappointment:
the system normally is not able to run a timer periodically with a period as small as
1 millisecond. Actually the following code runs for more than 15 seconds:
public class CPTest_FastTimer: CPTest {
System.Windows.Forms.Timer timer=new System.Windows.Forms.Timer();
int count=0;
DateTime start;
public override void Run(int arg) {
start=DateTime.Now;
log("start = "+start.ToString("HH:mm:ss.fff"));
timer.Interval=1;
timer.Tick+=new EventHandler(timer_Tick);
timer.Start();
}
private void timer_Tick(object sender, EventArgs e) {
count++;
if (count>=1000) {
log("got "+count+" ticks between "+start.ToString("HH:mm:ss.fff")+
" and "+DateTime.Now.ToString("HH:mm:ss.fff"));
timer.Stop();
}
}
}
On my system this generates the line
CPTest.log: got 1000 ticks between 15:12:47.140 and 15:13:02.953
What goes on is a timer creates a delay which tries to equal the smallest possible delay
equal to OR larger than what was asked for; since the system clock normally ticks at 64
Hz, this means all intervals shorter than 15 msedc get enlarged to that number !
BTW: there is a way to set the system clock in a "higher accuracy" mode, but I do not
recall how, and MS does not set it by default to preserve CPU resources and power ...
Luc Pattyn
|
|
|
|
|
This has absolutely no relevance, but:
class UglyClass {
public UglyClass() {
if (true) {
DoThis();
DoThat();
}
if (true) DoSomethingElse();
}
}
class PrettyClass
{
public PrettyClass()
{
if (true)
{
DoThis();
DoThat();
}
if (true)
{
DoSomethingElse();
}
}
}
|
|
|
|
|
bobsugar222 wrote: This has absolutely no relevance
I agree. I would add, your way wastes more space.
Luc Pattyn
|
|
|
|
|
Easier to read and maintain though... on top of being prettier
|
|
|
|
|
Splitting things into separate lines does not add beauty.
class
UglyClass
{
public
UglyClass
()
{
if
(true)
{
DoThis
();
DoThat
();
}
if
(true)
DoSomethingElse
();
}
}
If you want the extra space, add the extra space. Then it's intentional and worth something.
class PrettyClass {
public PrettyClass() {
if (true) {
DoThis();
DoThat();
}
if (true) {
DoSomethingElse();
}
}
}
---
Year happy = new Year(2007);
|
|
|
|
|
Once more I agree
Luc Pattyn
|
|
|
|
|
|
Hi,
I have just finished an article on timers, I trust it may well solve your problem.
I expect it will appear on CP in a matter of days.
Luc Pattyn
|
|
|
|
|
|
Hi,
this dialog seems very good, but is there a way to make it run under .NET 1.1? Or in other words, what makes it only compatible for 2.0?
BR
Alexander
|
|
|
|
|
What dialog?
---
Year happy = new Year(2007);
|
|
|
|
|
Oops, I must have posted my question in the wrong forum, but perhaps someone here can also help me with that. I mean the OpenDialogEx:
http://www.codeproject.com/cs/miscctrl/OpenFileDialogEx.asp
(I clicked "New Message" on the bottom of that page, now I am confused (about this forum), and there might be a cross-post somewhere else here... )
|
|
|
|
|
I Want Last Version OutlockBarApp Simular Visual Studio.Net 2005
Thank you
Send (Dll File) ...
|
|
|
|
|
im actually trying to make a player that can stream audio over the network in real time using Microsoft DirectX particularly direct sound.can anyone help me out with this problem please..im a newbie when it comes to audio programming..please i really need help as soon as possible...
mei
|
|
|
|
|
//eraser is gif file from resources
Bitmap bmp = new Bitmap(global::InkRecognition.Properties.Resources.eraser);
bmp.SetResolution(128f,128);
System.Windows.Forms.Cursor cursor = new System.Windows.Forms.Cursor(bmp.GetHicon());
this.Cursor = cursor;
somehow SetResolution just don't work. anyone help please
thanks
|
|
|
|
|
What do you expect it to do ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi,
I have a WinForm that needs to run only if a registry entry exists. If not, I want the application to immediately exit.
I don't believe you can call Application.Exit until after initialization of the form is complete.
Is there a workaround or better solution to achieve my needs?
Glen Harvy
|
|
|
|