|
Thanks Stark !
Let me ask this :
I have created a solution containing about 10 projects which some of them use a pre-designed sql database . I wanted to give a setup file to the user which must place all the required files including two files .mdf and a .ldf file (these are the database's files) and also attach the database to the localhost sql server. So I added a SqlServerProject which attaches the database to localhost server. This project works correctly on my computer when I run the solution in debugger of visual studio , but I don't know what to do , in order to add this functionality to my setup project . I know that when I right-click the SqlServerProject and click Deploy the project attaches the database. I want to know what to do with my Setup Project?!
|
|
|
|
|
Hi all I have a problem here and i'd appreciate any advice at all... I have like 20-something IF statements end else and else if (sample below)
if( something.Text != otherthing.Text )
{
if( MessageBox.Show("Really?") == DialogResult.OK )
{
}
else {
}
else Application.DoEvents();
...Except there's lots more if/else statements nested within one another. And it's very very time-consuming, confusing and after a while it just becomes too much to wrap my brain around. So I guess my question is... I vaigly remember somebody telling me to use Switch/Case things but I've tried reading about them on MSDN and I just can't seem to get my head around it can somebody please explain to me how the switch/case things would work.. In the most dumbest possible way? :P thanks for your time.
thanks lots
jase
p.s. sorry if my message doesn't make much sense this time, i haven't slept in 48hours lol
|
|
|
|
|
Hi,
I don't see how a switch might help you, retries means looping.
occasionally I put stuff like that inside a big loop, which provides automatic retries, until either something succeeds, or there is sufficient reason to abandon (in both cases use break or return).
Furthermore, it depends on what exactly you want to achieve, I sometimes use the if structures to set some bool flags, then when all decisions have been made, I execute what each bool flag stands for in straight code.
BTW: don't try recursion on this!
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
I assume this whole method is being called over and over. Therefore, you don't need an else on the inside, just wait for it to run again. At worst, put your Application.DoEvents inside the other else.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
You can't return to an IF statement... Well and about the switch, it's easy to use... you only have to watch the switch value, cause with it you're going to work in the 'case' statements... ex:
foreach (DataRow dr in ((DataTable)this.Dgv_Datos.DataSource).Rows)
{
switch (dr.RowState)
{
case DataRowState.Modified:
Regionalidades.Id_Regionalidad = Convert.ToInt32(dr["Id_Regionalidad"]);
Regionalidades.NombreRegionalidad = dr["NombreRegionalidad"].ToString();
Regionalidades.modificar(); }
break;
case DataRowState.Added:
Regionalidades.NombreRegionalidad = dr["NombreRegionalidad"].ToString();
Regionalidades.insertar(); }
break;
case DataRowState.Deleted:
Regionalidades.Id_Regionalidad = Convert.ToInt32(dr["Id_Regionalidad", DataRowVersion.Original].ToString());
Regionalidades.eliminar();
break;
}
} If you see over there, i've used the DataRow 'dr' to verify the RowState (Added, Modified or Deleted) of a DataGridViewRow... well the Namespace Regionalidades is a reference for the class, so it doesn't matter in the code... well i hope it helps...
|
|
|
|
|
Hi here is the 'new message'... i have a problem with datagridcomboboxcolumn... i think that i can't give to DataPropertyName the value of a string field in my table (only int), cause it displays me nothing T.T so... the main problem, i think it is because the form with the datagridviewcomboboxcolumn is opened from an MDI parent... that's the problem because when i open the form just normally, the datagridviewcomboboxcolumn displays me the data... What Can i do??? i need help with that
|
|
|
|
|
I'm putting together a dialog mockup that has a panel inside a groupbox. The panel has its border turned on and extends below the bottom edge of the groupbox (in the fully working dialog the panel in question will be in a scrolling control). The problem is that the panel is being drawn over top of the groupboxes border, leaving a 'hole' in it. What's the simplest way to make the mockup look right?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
if the Panel (or any other Control) is added to the GroupBox (see inside the designer.cs file to check), how could it extend beyond the GroupBox boundaries?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
The row of pixels that comprise the GB border is legal for child controls to paint on
<Crude ASCII Art Warning>
C is the groupbox border, A is the panel inside the groupbox. The panel extends another dozenish notional pixels below the edge of the groupbox, but that part is properly unpainted.
C AAAAAAAAAAAAAAAAAAAAAAAAAA C
C AAAAAAAAAAAAAAAAAAAAAAAAAA C
C AAAAAAAAAAAAAAAAAAAAAAAAAA C
C AAAAAAAAAAAAAAAAAAAAAAAAAA C
C AAAAAAAAAAAAAAAAAAAAAAAAAA C
CCCCCAAAAAAAAAAAAAAAAAAAAAAAAAACCCCC
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Yep, I had noticed that, I was expecting you had a more serious complaint than a one-pixel row overlap (it is a mockup after all, isn't it?)
Couldn't you (1) reduce the Panel height and optionally (2) Anchor it to the GroupBox bottom?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Luc Pattyn wrote: it is a mockup after all, isn't it?)
Which doesn't mean someone non-technical won't go "WTF Happened to that Border" when being shown the mockups. All things equal I prefer to avoid silly things for them to gripe about.
1) works as a bandaid, but since the dialog is a mockup and assured of changing size arbitrarily, and I need to keep a consistent spacing between the elements in the GB, hard coding a value doesn't really appeal unless it's the only option.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Im having problems with System.Drawing the code below only works when the user clicks the button but when set to the forms autostart option the line isn't drawn on the form . Ive tried thread.sleep but i get the same rusult the code is executed but nothing is drawb
private void Draw(object sender, EventArgs e)
{
System.Drawing.Graphics graphicsObj;
graphicsObj = this.CreateGraphics();
Pen myPen = new Pen(System.Drawing.Color.Red, 465);
graphicsObj.DrawLine(myPen, 120, 120, 1200, 1210);
}
private void button1_Click(object sender, EventArgs e)
{
System.Drawing.Graphics graphicsObj;
graphicsObj = this.CreateGraphics();
Pen myPen = new Pen(System.Drawing.Color.Red, 465);
graphicsObj.DrawLine(myPen, 120, 120, 1200, 1210);
}
hers my project
http://rapidshare.com/files/248914335/WindowsApplication1.zip
|
|
|
|
|
you need to use the Paint event of the form, and do you drawing in there. that way it will draw every time the form needs to paint itself...
use the event args to get the Graphics object too...
private void Form1_Paint(object sender, PaintEventArgs e)
{
Pen myPen = new Pen(System.Drawing.Color.Red, 465);
e.Graphics.DrawLine(myPen, 120, 120, 1200, 1210);
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
... and dispose of objects you create and no longer need, such as Pens; or better yet keep them alive as a class member.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hi
i have a table in my dataSet Designer, when i select a numerical field of my table, i can set some properties, one of those is NullValue, as u know, it is initialize with 'Throw exception', my problem is that i can't change this item to Null or Empty, whereas i set allow null my field in database, hence at runTime, when this is field has null value, it throw exception.
how to avoid this problem ?
thanks
|
|
|
|
|
hdv212 wrote: as u know, it is initialize with 'Throw exception'
Uhhh, I have no ideo what you're really trying to say here, but nothing is initialized with "Throw Exception".
I think the value you're looking for is DBNull.Value, not null.
|
|
|
|
|
Good day
I am writing a video recognition program in VC#. I have done a lot of reading on webcam data acquisition, but the abundance of information isn't guiding me to an answer.
Could you please give me an overview of:
1. What video format is best (or commonly used) for processing real-time video? Must the raw video first be converted to the required format?
2. In what format should I record a clip(few frames) or an image (single frame) from the webcam, when I want to apply my algorithms to it?
3. And what API could be useful to do all of this? I'm currently looking at AForge
I'm asking this because it would obviously be desirable to keep the image, video and real-time video in the same format in order to write less code, and performance is also very important to me (ie don't know if different formats influence algorithm performance)
|
|
|
|
|
All of this is going to be determined by your webcam and the API used to get an image or video stream from it. Whether it's going to work for you or not depends on how you write your processing algorithm.
|
|
|
|
|
But, according to OP's previous post, not allowed to use an API.
I think he/she is stuck.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
You've done a lot of reading ?
1 - All video ends up as raw frames. DirectX is going to let you access those frames, and it's not really going to matter how it was encoded along the way, your code ends up sitting in the sequence that decodes the video. I don't believe C# can do this, not without using a third party library to help you get access to DirectX. http://slimdx.org/download.php[^] is one that I found out about recently, but I've not looked at it.
2 - does not matter
3 - Ultimately, DirectShow is part of DirectX, and is your best bet, but in C# you will need some sort of wrapper, like the one I linked to, to get access to it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Okay thank you, I've done a lot of reading but it's been very misguided
When you say "raw frame" do you mean basic memory containing two or three bytes of info on each pixel (depending on RGB, greyscale etc.) which is contained in - for example - an array? (Independent of the video format and API used) Which one can then convert to which ever format you wish (or can), eg. jpg, bmp etc..
|
|
|
|
|
Hi,
This is a new one to me but Ill set the scene,
Would appreciate any support from people who currently or have done this.
We have thousands of products that are going to go through a production line,
the prodcut comes to us with a barcode already attached.
I need my users to scan the item at each stage, ie received the item, assebled, test, etc...
We are developing a .net (ideally asp.net but would do win forms if needed)that
will need to record the barcode (unique id) and add several infomation items to that record along the line.
So,
I need to Find a barcode scanner that will read the bardcode, and I can interact with in my .net application (all data will be stored in sql).
thanks
|
|
|
|
|
|
You can use asp.net.
When you scan barcode, it will simple write out barcode and usually give an CR and LF on end.
So, you should give focus to barcode field on form, and once user scans code it will write code in that field. All scaners do it the same way, only that you can make in some cases define what to return on end. Also, be aware that you will not know in asp.net when data actually comes from scanner, and not from user. When scanner returnes data, it's just like keyboard strokes, you cant know when this happens. So, barcode field should have focus when you start scanning.
|
|
|
|
|
Enver Maroshi wrote: You can use asp.net.
How come ASP.Net is going to help?
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.
|
|
|
|
|