|
An unhandled exception of type 'System.StackOverflowException' occurred in me.
|
|
|
|
|
Sorry if I'm wasting your time...
I'm not an expert like you...
Yeah, I know Recursion, I'll use it...
Thanx
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Hey there,
I have a DataSet dsGalery among others containing the DataTable tblGalery in my program that I want to display in a DataGridview dgvGalery.
tblGalery contains 3 Columns:
1. ID (int)
2. Picture (System.Object) containing System.Drawing.Bitmap
3. Title (System.String)
when I set the Datasource of dgvGalery:
dgvGalery.DataSource = dsGalery.Tables["tblGalery"];
Everything is shown correctly except for the Images. Can anyone tell me how I can tell the second column in the DataGridView to display the Image?
thanx in advance
der gunnar
|
|
|
|
|
Hello. I am looking for a method of using files in C# that act similar to Databases (i.e. in tables) that will load successfully into Visual C# Express edition without having to have a seperate program to run the database. Preferably something simple like text files but allowing for better structure (like database tables).
Thanks.
|
|
|
|
|
u can use LINQ Method, in vs2008 & C#3.0...
|
|
|
|
|
You might want to look at SQL Server CE - which is a low footprint database that runs as a DLL in your application process space, i.e. no separate database to install.
|
|
|
|
|
Tried that. Asked below (see 'Connecting to a c# local datbase')
Didn't work too well (couldn't connect to it properly)
|
|
|
|
|
Well it does work, and is the solution for your problem. Try googling the msdn for a walkthrough.
|
|
|
|
|
You can use the WriteXml and ReadXml methods to save a DataTable as an xml file. That would give you at least the most basic fetures of a database with no installation needed.
Perhaps you should consider using an MS Access database? It's file based and the drivers come pre-installed with windows.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Try SQLite. It's free, fast, needs only one dll and has ado.net managed provider. System.Data.SQLite[^]
|
|
|
|
|
Thanks, Tried it before & didn't work but since discovered how to add the library. So I will try it again.
|
|
|
|
|
hi evreone
i have some question
1. how to make package that have inside FrameWork 2.0 and Uninstaller ?
2. how can i send control to class ?
thank's alot for any help
|
|
|
|
|
E_Gold wrote: 2. how can i send control to class ?
What do you mean? Talk more clear my friend...
While (true) { Human.isLearnable = true; }
|
|
|
|
|
i have ComboBox that i want to fill whit Database from dataset
the action for fill is in my class
i whant that in the main form i can wright ComboBox1.MyClassName.Fill(sql query)
is it posible ?
thank's alot
|
|
|
|
|
You can do many tasks to solve it except
E_Gold wrote: ComboBox1.MyClassName.Fill(sql query)
Search for SqlConnection, SqlCommand and SqlDataReader, they might help you.
While (true) { Human.isLearnable = true; }
|
|
|
|
|
For a start your class (presumably it gets the data) should not be working with a UI control (there are exceptions to this of course). Have your class return a datatable and the code behind the form should then bind the table to the UI control.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Either include the .Net 2.0 installer with your installer, or have it download if necessary from the same place your installer was download from.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello world!
I have an application with C# & I want to attach a scanner and scan some pics and manage it and so on...
I think i must to have a scanner component but I not find a free of this.
tnX world!...
|
|
|
|
|
Most scanning is done using the TWAIN API. If you google for twain c# you should get plenty of results.
To get you started, NETMaster[^] has an article here on CP[^] on this very subject. It was written in 2001 but I don't think things have changed much in the scanning world since then.
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)
|
|
|
|
|
|
I have a viewer of word in my application and I want to manage it`s Print event.
it means I want, when user presses Print Button in my application toolbarit happens the same occur that we press "Ctrl+P" in Microsoft Word
What should I do for this
Thanks in advance
Hello Friends
|
|
|
|
|
|
How to print content of RichTextBox
Hello Friends
|
|
|
|
|
Suprisingly, a Google search for print richtextbox c#[^] brings up a plethora of results.
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)
|
|
|
|
|
HI,
I have a little application that downloads Adam Carolla podcasts. Right now, it does not contain threading. I have read a lot of articles and get the concept, but I am drawing a blank when it comes to actually implementing it in my application.
If anyone could take the time to add threading to this app, I would greatly appreciate it. If you're a fan of the Ace Man, feel free to use this. I am really hoping to understand this via my real life example so I may truly grasp the concept enough to be able to do this myself on other apps.
I only want to download two MP3s at a time. This is .Net 1.1 code.
Regards,
Mark
the code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using System.Xml;
using System.Xml.XPath;
using Pantheon.Software.Networking;
namespace FetchAceMan
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnFetchAceMan;
private System.Windows.Forms.ListBox listContents;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Label lblProgress;
private System.Windows.Forms.Label lblActivityLog;
private System.Windows.Forms.Label lblURLList;
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
#endregion
#region Handler for the "Get the URLs" button
private void btnFetchAceMan_Click(object sender, System.EventArgs e)
{
GetTheURLs();
GetTheMP3s();
}
#endregion
private void GetTheURLs()
{
string strAceManRSS = "http://www.971freefm.com/pages/podcast/43.rss";
XmlDocument doc = new XmlDocument();
doc.Load(strAceManRSS);
XPathNavigator nav = doc.CreateNavigator();
XPathExpression expr;
expr = nav.Compile("/rss/channel/item/link");
XPathNodeIterator iterator = nav.Select(expr);
listContents.Items.Clear();
try
{
while (iterator.MoveNext())
{
XPathNavigator nav2 = iterator.Current.Clone();
listContents.Items.Add(nav2.Value.Trim());
}
}
catch(Exception ex)
{
textBox6.Text += ex.Message + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
}
finally
{
listContents.Refresh();
}
}
private void GetTheMP3s()
{
this.textBox6.Clear();
try
{
string targetDir = @"c:\AdamCarollaShow";
if (!Directory.Exists(targetDir))
{
DirectoryInfo di = Directory.CreateDirectory(targetDir);
}
}
catch (Exception ex)
{
textBox6.Text += ex.Message + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
}
finally {}
FileStream fs = new FileStream(@"C:\Program Files\McMorrine\Get the AceMan\LastDownload.txt", FileMode.OpenOrCreate);
StreamReader r = new StreamReader(fs, Encoding.UTF8);
int lastFile = int.Parse(r.ReadLine());
r.Close();
fs.Close();
int numItems = listContents.Items.Count;
int theItem = numItems - 1;
while (theItem >= 0)
{
DoDownload(listContents.Items[theItem].ToString(), lastFile);
theItem --;
}
textBox6.Text += "****" + System.Environment.NewLine +
"All of the files have been downloaded." + System.Environment.NewLine +
"They can be found in the C:\\AdamCarollaShow directory" + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
}
#region DoDownload file downloading routine
private void DoDownload(string theItem, int lastFile)
{
try
{
FileDownloader downloader = new FileDownloader();
downloader.DownloadCompleted += new FileDownloadCompletedEventHandler(downloader_DownloadCompleted);
downloader.DownloadProgressChanged += new FileDownloadProgressChangedEventHandler(downloader_DownloadProgressChanged);
downloader.DownloadStatusChanged += new FileDownloadStatusChangedEventHandler(downloader_DownloadStatusChanged);
String strFile = theItem;
int intFileExt = strFile.IndexOf(".mp3");
int intFileNameStart = strFile.LastIndexOf("/");
int fileNameForDownload = int.Parse(strFile.Substring(intFileNameStart +1, intFileExt - (intFileNameStart + 1)));
string strFileName = strFile.Substring(intFileNameStart +1);
this.textBox6.Text += "Filename to download: " + strFileName + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
if (fileNameForDownload > lastFile)
{
this.textBox6.Text += "Download the file " + strFileName + "." + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
FileStream fs = new FileStream(@"C:\Program Files\McMorrine\Get the AceMan\LastDownload.txt", FileMode.Create);
StreamWriter w = new StreamWriter(fs, Encoding.UTF8);
w.Write(fileNameForDownload.ToString());
w.Flush();
w.Close();
downloader.Download(new Uri(theItem), @"C:\AdamCarollaShow");
}
else
{
this.textBox6.Text += "Already have " + strFileName + ", skip the download." + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
return;
}
}
catch(Exception ex)
{
textBox6.Text += ex.Message + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
}
}
#endregion
#region downloader_DownloadCompleted
private void downloader_DownloadCompleted(object sender, FileDownloadCompletedEventArgs e)
{
this.progressBar1.Value = 0;
textBox6.Text += "Download complete." + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
}
#endregion
#region downloader_DownloadStatusChanged
private void downloader_DownloadStatusChanged(object sender, FileDownloadStatusChangedEventArgs e)
{
textBox6.Text += e.Message + System.Environment.NewLine;
textBox6.Focus();
textBox6.Select(textBox6.TextLength, 0);
textBox6.ScrollToCaret();
}
#endregion
#region downloader_DownloadProgressChanged
private void downloader_DownloadProgressChanged(object sender, FileDownloadProgressChangedEventArgs e)
{
this.progressBar1.Value = e.ProgressPercentage;
}
#endregion
}
}
|
|
|
|