|
Bryden.Murdoch wrote: allow me to learn a lot more about c#.
I seem to have got the goals mixed up , this one I can relate to.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
I was coming to this forum hoping to help people but then I read this and my brain just kindof BSODed trying to interpret the code as C#
It's not really a problem, but maybe you should try the ASP forum?
|
|
|
|
|
hey guys,
i have a dataset which is bound to a gridview , i would like to make the first row in the dataset as the last row in the dataset or in the gridview ( eventually i need it for the gridview) what is the most effective way to do such simple task?
Net
|
|
|
|
|
i want to use web space for some files. and i want to build a software that can be install on computer,and by that software i can search some files in that particular web sapce and also downlaod that files and also can upload some files......... is it possible with C#???????
|
|
|
|
|
Yes
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
That's called FTP. You wan't to make an FTP client.
|
|
|
|
|
pls tell me how i use?
i also wanna some database which database should i use? and how? pls guide me
Thanx.
|
|
|
|
|
Why would you want to use a database? Ftp would be comparable to traversing a tree structure using recursion, you wouldn't need a database..
|
|
|
|
|
My need is to make "video collection system" for my final year project. I already make it for LAN,but now i want to make it web base application so that any one can install application implemented in C# and download videos from web from anywhere and also can upload video. It is something like Metacafe.
Pls tell me how i can build this. Provide me some guide line.
Thank you for kind support
|
|
|
|
|
Hello,
I am working on a project in vs2008 (C#). The problem facing is when i open a mdi parent form in maximize style and then open any other form on that form i always open as maximize
Thank You!
|
|
|
|
|
The WindowState of the MdiParent makes no difference. If one ChildForm is Maximized then so are all ChildForms however.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi,
I'm using C#.net 3.0. I have use the frameGrabber class to grab the frames from the video file and to convert the frames into bitmap format.The code is giving error in the "foreach (FrameGrabber.Frame f in fg)line of the code" highlighting "in" giving error---"InvalidCastException was unhandled by user"(Unable to cast COM object of type'DirectShowLib.DES.MediaDet' to interface type 'DirectShowLib.DES.IMediaDet'.This operation failed because the QueryInterface call on the COM component for the interface with IID '{65BD0710-24D2-4FF7-9324-ED2E5D3ABAFA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).).I use this background worker so that I can stop the extraction of frame in middle of execution,but if i don't use this Background worker the code is running properly.
[code]
private void button43_Click(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
private void button44_Click(object sender, EventArgs e)
{
backgroundWorker1.CancelAsync();
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
string outPath = txtExtBitmap.Text;
System.IO.Directory.CreateDirectory(outPath);
if (fg != null)
{
foreach (FrameGrabber.Frame f in fg)
{
using (f)
{
picBoxFrame.Image = (Bitmap)f.Image.Clone();
f.Image.Save(System.IO.Path.Combine(outPath, "frame" + f.FrameIndex + ".bmp"), System.Drawing.Imaging.ImageFormat.Bmp);
}
if (fg == null)
{
return;
}
}
}
if (backgroundWorker1.CancellationPending)
{
e.Cancel = true;
return;
}
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Cancelled)
{
MessageBox.Show("Operation Cancelled");
}
else
{
MessageBox.Show("OperationCompleted");
}
}
[\code]
|
|
|
|
|
Not sure about the specific error, but the CancellationPending check should be inside the foreach loop otherwise it won't be reached until all the frames have been 'grabbed'and the method is about to return anyway, which makes it kind of pointless.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
Yeah, I've had a look and I'm not sure about that, but a least when you fix it you'll be able to cancel when you wish.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi!
There is a solution for leave RowState unchanged when the user edited
a cell, but its value is not changed?
I am using OnEnter edit mode and if I enter another row the database
everytime is updated with the previous row regardless it is changed or
not.
Thanks!
|
|
|
|
|
Hello,
I am having problems populating a second DataTable to use as a data source for a second datagridview on another form. The second DataTable is pulling data in from the main datagridview using a query but the second datagridview doesn't populate. Can someone point me in the right direction please? Here is the code I am running:
Form1:
string Query = ("SELECT DISTINCT product FROM [" + dataGridView1 + "]");
DataTable GetDocs = new DataTable(Query);
DataRow NewLine;
NewLine = GetDocs.NewRow();
GetDocs.Rows.Add(NewLine);
private DataSet Sds;
public DataSet GetDocs
{
get
{
return Sds;
}
set
{
Sds = value;
}
Form2:
InitializeComponent();
GetForm1 = new Form1();
object GD = GetForm1.GetDocs;
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView2.RowHeadersVisible = false;
this.dataGridView3.RowHeadersVisible = false;
this.dataGridView4.RowHeadersVisible = false;
this.dataGridView1.DataSource = GD;
Tahnk you,
Brenton
|
|
|
|
|
Did you paste in the code, or type it?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
The code came from a couple of sites but I typed it in and modified to fit my needs.
|
|
|
|
|
OK. I meant, did you paste it into this site, or type it. But ignore that for now.
Without trying to follow what your code is trying to do, a couple of things spring out.
You have two members with the same name, in the same scope.
DataTable GetDocs = new DataTable(Query);
and
public DataSet GetDocs
Now the compiler should have given you a warning at the very least, unless you have warnings turned off.
Did you ignore the warnings? Because as things are the line from Form2 object GD = GetForm1.GetDocs; will return the second of these which doesn't seem to get initialised anywhere.
Turn on warning level 4, if it's not already on. Recompile and sort out any warnings.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Sorry, misunderstood you. Yes I did paste it into the message.
I checked to see if warnings where turned off and it doesn't seem to be. I clicked on properties in the solution explorer tab and it looks to be ok. Is there another place I can do this? Otherwise, when I run the app it gives no signs of errors or warnings.
I thought both the lines of code are needed. The first one is to declare a new DataTable. The second line is to pass the DataTable to the second form. Is this not correct? I did it this way because that is how you helped me with passing the delimiter to different forms in the last posting I have. Is there a difference when passing strings versus objects?
Thank you,
Brenton
|
|
|
|
|
Lets try to sort this out one bit at a time.
In Form1 you have:
private DataSet Sds;
public DataSet GetDocs
{
get
{
return Sds;
}
set
{
Sds = value;
}
Then in Form2 there is:
object GD = GetForm1.GetDocs;
Since the GetDocs property in the first block above is the only public GetDocs on Form1, it must be that one that GD points to. The getter for GetDocs returns Sds . Now I cannot see anywhere on either form where Sds gets assigned to. I could well be wrong, however because of the way you have named the various members, it is very very difficult to follow what is happening.
It is recommended (in the Microsoft Style Guide for C#) that where there is a private field with a public accessor (your Sds and its property GetDocs , from the first code block above), the names should be the same but differentiated by case.
So can I suggest that you rename those to match that style. First, just to make it easier to work through please use Sds as the name for now, you can change it to whatever you want later.
1. Hover the mouse pointer over the Sds in the line private DataSet Sds;
2. Right-click
3. From the context menu, hover on 'Refactor' and from the sub-menu select 'Rename'
4. A Dialog will pop up with Sds in a textbox, change that to sds (all lower case) and click OK.
If all has gone well the code should look like this
private DataSet sds;
public DataSet GetDocs
{
get
{
return sds;
}
set
{
sds = value;
}
Repeat the above 4 steps for the GetDocs from the line public DataSet GetDocs and change it in the textbox to Sds and click OK.
Again if all has gone well you should have
private DataSet sds;
public DataSet Sds
{
get
{
return sds;
}
set
{
sds = value;
}
With any luck at all the Refactoring will have taken care of Form2 as well, and the line object GD = GetForm1.GetDocs; on Form2 will have become object GD = GetForm1.Sds; .
I am sorry if I have over simplified anything in this post, or explained something you already know how to do. I am not intending to be insulting, just trying to make sure we are on the same wavelength.
Come back when you are there.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
I have made the recommended changes. Also, I don't think using DataSet for the GetDocs property was correct so I changed it to DataTable. Here is what I have:
Form1
string Query = ("SELECT * FROM [" + dataGridView1 + "]");
DataTable Sds = new DataTable(Query);
DataRow myNewRow;
myNewRow = Sds.NewRow();
Sds.Rows.Add(myNewRow);
private DataTable sds;
public DataTable Sds
{
get
{
return sds;
}
set
{
sds = value;
}
}
Form2
GetForm1 = new Form1();
object GD = GetForm1.Sds;
this.dataGridView1.DataSource = GD;
modified on Monday, May 18, 2009 1:02 PM
|
|
|
|
|
Hi, have a good weekend?
The problem is, that there are still two members with the same name, which could get confusing. However if the compiler doesn't complain, why should I.
The next problem to tackle is the line string Query = ("SELECT * FROM [" + dataGridView1 + "]");
I don't know if you know how to use breakpoints, the debugger and single stepping, but if you do you will be able to determine that
it evaluates to
SELECT * FROM [System.Windows.Forms.DataGridView]
at runtime.
Whereas I suspect that you want it to get the data from the table whose name is selected in dataGridView1.
Is that correct?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|