|
I'm quite lost. I think it's simple, but I can't find the article or forum answer...
I have a dataset. I have bound diffrent columns to different textboxes.
Now...
¿How do I move throught the dataset? I just need to navigate through the dataset and then bound controls should automatically update. How to:
- Move next/previous record
- Seek or find records.
Thanks!
NOTE: By the moment I'm using Visual C# 2003 with NET Framework 1.1...
|
|
|
|
|
not sure if it works in that version of c# that you are using or not I'm using c# visual studios 2008 express edition. But anyway what I use is the bindingnavigator toolstrip
it does just that adds a forward back and list the number of items like 1 of whatever. lets you skip to the front to the end and then add remove save... and then you simply take and have your controls bound to the data in the datasource. and it will automatically update.
How i went about doing it in my project was I took and added a database using the whole data>add data source thing in the compiler. Once that was done I took and went under the data source thing that it creates on the left side of the compiler. I simply dragged the table onto my form and it makes a dataview along with the cool little toolstrip navigator. i simply remove the dataview and keep the toolstrip. then i go back to the datasource thing and select the individual items i wish to add to the form and simply drag them over. You can hit the little drop down to change it from a text box to a combo box to whatever. Then the control is bound to that datasource. so now when you use the navigator it will move forward or back. and the controls will automatically update. I think this is what you were looking for. If not i'm sorry for misunderstanding..
|
|
|
|
|
This is exactly what I need, but... I don't have this control
As I have recently read somewhere, I think I must try working with CurrencyManager, and implement it by myself. Let's see what can I find out... specially for SEEKING records.
Thanks, anyway!
|
|
|
|
|
I just want to ask what are some of the errors that OleDbException exception handler usually handles?
is the scenario of having a failed connection to the database one of the errors?
I can't find a detailed list of all the exception handlers usually used in database programming.
|
|
|
|
|
Deadlocks, timeouts, referential integrity problems...
Duplicate keys...
|
|
|
|
|
Ok. Thanks for your answer.
|
|
|
|
|
I've got a small C# app that runs as a service on a Windows 2003 SP2 server. It has a main thread that loops and checks and processes socket IO, a secondary thread that does a listen for incoming connects, and System.Threading.Timer. For some reason, in the last few days, the app timer has NOT been getting triggered. I've put some comments in the code, restarted it, etc and definitely confirmed that the callback function is not getting called. Has anyone else run into this? How did you resolve it? I found some info via Google that mentioned problems with Windows 2003 SP1, but that doesn't seem like it would affect me since I'm running SP2.
|
|
|
|
|
Jim Crafton wrote: I found some info via Google that mentioned problems with Windows 2003 SP1, but that doesn't seem like it would affect me since I'm running SP2.
Does the server have a multicore-processor? You might want to try using this test-application[^] to verify whether it's the old bug that's reported for .NET 1.1, or whether there's something else going on.
I are Troll
|
|
|
|
|
It's not multi-core but it is multi-processor, if I recall right, its an Intel dual CPU Hyperthreaded system, with Task Manager showing 4 "cpus". We are using .Net 1.1, so perhaps this is related to your link, that's similar to the stuff I ran across. But I read another post that mentioned that this bug was also present in .Net 2.0, so I'm not sure if it's even worth "upgrading" the code.
|
|
|
|
|
There seems to be a fix for 1.1[^] from Microsoft.
Jim Crafton wrote: But I read another post that mentioned that this bug was also present in .Net 2.0
Yup, I read the same. Not many people mentioned 3.0 or 3.5 though
I are Troll
|
|
|
|
|
Try turning off your port listener and see if the timer messages start getting sent again...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
how to insert long string in sql columns?
string a = "
نخستین بنیاد خلاقیت هوشمندان بین الملل در یزد راه اندازی شد یزد - خبرگزاری مهر: بنیاد خلاقیت هوشمندان بین الملل با سرمایه گذاری سه میلیارد ریالی بخش خصوصی در یزد راه اندازی شد.
رئیس هیئت مدیره بنیاد خلاقیت هوشمندان بین الملل در گفتگو با خبرنگار مهر در یزد اظهار داشت: این بنیاد نخستین بنیاد خلاقیت کودک در کشور است که کودکان و نوجوانان را از سن سه تا 18 سال تحت پوشش قرار می دهد.
مسیب خانی افزود: در حال حاضر فاز نخست این بنیاد مربوط به کودکان سه تا شش سال همزمان با میلاد مسعود امام رضا(ع) در یزد کار خود را به طور رسمی آغاز کرده و در بخشهای مختلف به کودکان سه تا شش ساله زبان انگلیسی، فیزیک، شیمی، زیستشناسی به همراه کارگاه آموزشی به زبان ساده، کارگاه سفالگری، نقاشی، تئاتر، موسیقی، ورزش، شنا و ... در راستای شکوفایی استعدادها و پرورش خلاقیت آموزشهای ویژه ای ارائه آموزش می دهد.
وی خاطرنشان کرد: در مجموعه این بنیاد چندین کارگاه راه اندازی شده که هر یک از این کارگاه ها مختص یک آموزش است و فضای کارگاه نیز از ابتدا به وسایل و امکانات مورد نیاز هر گارگاه تجهیز شده است.
رئیس هیئت مدیره بنیاد خلاقیت هوشمندان بین الملل ادامه داد: از آنجا که کودکان سنین سه تا شش سال آمادگی چندانی برای حضور رسمی در کلاسها ندارند، هیچ اجباری در این زمینه برای آنها وجود ندارد و کودکان به نحو دلخواه خود در کلاس حضور می یابند و مربیان نیز خود را با شرایط کودک وفق می دهند که به این منظور نیز علاوه بر میز و صندلی، قسمتی از کارگاه ها و کلاسها مفروش شده است.
وی همچنین با بیان اینکه در این بنیاد حتی کودکان توانخواه نیز امکان حضور دارند، عنوان کرد: در کلاسهای این بنیاد کودکان توانخواه و معلول جسمی از دیگر کودکان جدا نمی شوند و در کنار دیگر کودکان در کلاسها شرکت می کنند و آموزش می بینند و تنها مسئولیت بیشتری در زمینه آموزش و نگهداری آنها متوجه معلمان و مربیان است.
خانی بیان داشت: در کلاسهای بناید خلاقیت هوشمندان بین الملل برای هر 12 کودک یک مربی با تحصیلات عالیه برای تدریس و یک مربی برای نگهداری از آنها در نظر گرفته شده است.
وی در بخش دیگری از این گفتگو با تشریح فضای فیزیکی این بنیاد اظهار داشت: این مدرسه در فضایی به وسعت هزار مترمربع و زیربنای 700 متر در سه طبقه احداث شده و دارای 15 کلاس است و هر کلاس تقریبا 30 متر وسعت دارد.
خانی افزود: این بنیاد مجهز به استخر، سالن غذاخوری، پیشرفته ترین سیستمهای اطفاء حریق و سیستمهای ایمنی است و در استخر نیز زیر نظر مربی و نجات غریق، شنا به کودکان آموزش داده می شود.
وی یادآور شد: در این استخر آبشار بزرگی به ارتفاع پنج متر و عرض سه متر به همراه برکه در مقابل آبشار دارای ماهی های زنده و متنوع جهت آموزش زیستشناسی، فضای سبز و درختان، زیستگاههای حیواناتی نظیر لاکپشت، ماهی، قورباغه، مار آبی و ... تعبیه و راه اندازی شده است.
خانی همچنین ادامه داد: تمامی فضاهای این ساختمان از جمله ابعاد، ارتفاع پلهها، نردهها، شیرآب، حمام، سرویس بهداشتی و ... بهداشتی و مناسب کودکان سنین سه تا شش سال استانداردسازی شده است.
وی با اشاره به اینکه علاوه بر هشت کادر اداری، بیش از 30 معلم با تحصیلات عالیه کار مربیگری در این بنیاد را انجام میدهند، بیان داشت: زمان برگزاری کلاسهای این بنیاد همانند آموزش و پرورش است و این آموزشها طی 9 ماه از اول مهر تا پایان خرداد به کودکان ارائه می شود.
خانی با بیان اینکه در این بنیاد توانمندسازی کودکان و ارائه آموزشها و مهارتهای زندگی در دستور کار قرار گرفته است، خاطرنشان کرد: هر شش ماه برنامه شبیهسازی شده کسب و کار در این بنیاد اجرا میشود و کودکان این بنیاد در نمایشگاهی آثار و ساختههای دست خود در کارگاههای آموزشی را به خانوادهها می فروشند و درآمد آن را صرف مصارف عام المنفعه میکنند.
وی تصریح کرد: برای راهاندازی این بنیاد 30 نظام آموزشی رایج در دنیا توسط کارشناسان بررسی و نقاط ضعف و قوت آن رفع و تقویت کردیم و که در نهایت در این بنیاد به معرض اجرا درآمد.
خانی همچنین با بیان اینکه این بنیاد نخستین بنیاد علمی، آموزشی، خلاقیت، نوآوری و کارآفرینی کودک و نوجوان ثبت شده در کشور است و در این بنیاد هر چیزی که کودک به آن نیاز داشته باشد، در راستای برنامههای آموزش و پرورش به کودکان ارائه میشود.
بنیاد خلاقیت هوشمندان بینالملل به طور رسمی به همت مسیب خانی، محمد فقیه خراسانی و محمدرضا حاجی قاسمی به عنوان هیئت موسس فعالیت خود را در کوچه ارکیده بلوار جمهوری یزد، آغاز کرده است
";
|
|
|
|
|
wow!!!
ever heard of a ntext[^]?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
How to open the form like pop-up alertation of some softwares (but the form must open(appears) from down to up )!!
|
|
|
|
|
what about doing your project for you?!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
I am doing a very big project.
If can help ,Please do a favor and help me instant of ......
Thanks for help!!
So what should i do now?
|
|
|
|
|
Create the instance of the form you want to show and then use ShowDialog method to display it. In that form, handle the paint event and change the location of the form by same amount till it gets to the needed position. I am not sure how smooth the movements will be but I hope it would depend on the amount by which you move the form.
"No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
Thanks !
I finsihed it:
private void Form1_Load(object sender, EventArgs e)
{
Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height + x);
this.Location = p;
timer1.Enabled = true;
timer1.Interval = 1;
}
int x = 388;
private void timer1_Tick(object sender, EventArgs e)
{
if (x == 0)
{
timer1.Enabled = false;
this.Close();
}
else
{
Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height + x);
this.Location = p;
x--;
}
}
|
|
|
|
|
Hi all,
Let's say I have a class called myClass, the following code is fine:
myClass myInstance = new myClass();
if (myInstance == null)
However, the following code will not compile:
myClass myInstance;
if (myInstance == null)
The above will give a compile error (Use of unassigned local variable 'myInstance')
My question is, can I make a class nullable so that the above code will compile and work?
|
|
|
|
|
Dewald wrote: myClass myInstance;if (myInstance == null) //some code here that I do want to execute if the variable has not been instantiated
change it to:
myClass myInstance = null;
if (myInstance == null)
|
|
|
|
|
Ha! Such a simple solution. Thanks, that's exactly what I wanted and I feel rather silly not to have known it.
|
|
|
|
|
Dewald wrote: Such a simple solution
well, answers and questions are always simple and easy... its the combination of those which is deadly
cheers!!
|
|
|
|
|
The Nullable stuff applies to value types; reference types are always nullable, as a reference can be null, you don't need anything new for this.
Your compiler error message told you "use of unassigned local variable", which is correct as "myInstance" in your second snippet did not have a value assigned, not even null. (in C# class members have a default value, local members don't).
myClass myInstance=null;
...
if (myInstance == null) ...
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
|