|
actually i wanted to fill the combobox from a table in the data base , the code is :
private void fill_locations() {
string st = combo_origion.Text;
SqlDataAdapter dtp = new SqlDataAdapter("get_locations", conn);
dtp.SelectCommand.CommandType = CommandType.StoredProcedure;
dtp.SelectCommand.Parameters.Add("@type_text", SqlDbType.NVarChar).Value =combo_origion.SelectedValue.ToString();
DataSet chds = new DataSet();
dtp.Fill(chds);
combo_locations.DataSource = chds;
combo_locations.DisplayMember = "location";
combo_locations.ValueMember = "location_id";
}
the error is at the last line.
|
|
|
|
|
The error says that the column "location_id" doesn't exist in the returned data table.
Perhaps the actual column name is "location id"?? That should be specified in your code as "[location id]".
|
|
|
|
|
in this line
combo_locations.DataSource = chds;
replace with
combo_locations.DataSource = chds.table[0];
try it
|
|
|
|
|
I have HTML tutorial site http://frogleg.mvps.org/helptechnologies/htmlhelp/hhtutorials.html[^]
Now I need a site(book) to help me use the compiled HTML code more effectively in my application. I would like a detailed book or website that addresses how to best use the helpprovider object to allow scalability and easy of use.
Any input to help would be appreciated.
Thanks
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Hi all,
How can i pass a Arraylist from one form to other?
thanx.
|
|
|
|
|
Colin Mackay has an article on this site about passing values from one form to another. You can do the same concepts he points out, with Arraylist.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
What is it with people passing objects from one form to another? Why not take a look at using design patterns such as MVC instead? That way, you'll only have one model, but you'll have multiple views on the model.
|
|
|
|
|
Pete O'Hanlon wrote: Why not take a look at using design patterns
I agree. It gets kind of old with these passing-something-from-one-form-to-another-type questions. There really isn't much too it.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
It really does. I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types.
|
|
|
|
|
Pete O'Hanlon wrote: I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types.
Congrats! That is the first new sig for 2008 I'll add to my collection
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thanks. I'm glad to be off assistance.
|
|
|
|
|
Hi all,
this question might not fall into the C# category, and actually I'm not sure at all what category would fit better. But here it goes:
I have a web application that displays a list of binary files which are stored in a database, and allows the user to view these files. Most of these files are images, and are viewed in a separate browser window. But some of them will be Office documents and perhaps other types (.pdf etc.).
When the binary files are images, they will be displayed in this new browser window with no difficulty. If the file is of some other type, then sometimes the document can be opened as an embedded file, but sometimes it cannot (Firefox for instance doesn't seem to allow embedded documents, such as Office documents, and .msg files are never displayed inline in the browser). So if the file is, say, an .msg Outlook mail file, the browser will ask the user if it wants to save the file to disk or if the user wants to open the file.
And here is my problem: under some circumstances (which I haven't been able to identify fully, but seems to happen all the time at my client site), when the user chooses to "Open" the file, he will receive an error from the application which is supposed to take care of opening the file. This error message says something along the lines of "Cannot open the file <path to="" a="" file="" in="" the="" users="" temp="" folder="">, the file may not exist, or you may not have the required permission etc. etc." (note this is not the actual error message, since the client isn't using English versions of Windows/Office). But if the users would choose to Save the file - and *then* to open it, then everything works according to plan.
So are there any thought/ideas/suggestions? Somehow I cannot see where the problem lies, since my web application is simply delivering binary data (using Response.BinaryWrite in ASP.NET - C#), and this binary data *is* properly downloaded (otherwise the user wouldn't be able to save the file), but for some reason he gets this error message.
Any help whatsoever would be highly appreciated!
Best regards,
Daniel
|
|
|
|
|
It still boils down to if the browser can support the file, though you are simply delivering binary data.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi,
C#, VS2005
Is there a simple way to ftp a folder including all sub folders and files to a remote ftp site?
Thanks in advance
Chas
|
|
|
|
|
Have you tried google[^]? It has lots of code examples showing the usage of FTP classes in the framework itself and others that are avalible.
|
|
|
|
|
I have a few C# files that need to be built using hte .Net 1.1 tools, not the 2.0 tools. Usually I could do this at work using VS 2003, however I'm at home today, and I don't have VS 2003. Is there any easy way to get a build using the info in the .csproj file? Or do I need to figure this all out by hand? Alternately, is there any way to get VS2005 (standard edition) to use the .Net 1.1 compilers/tools?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Jim Crafton wrote: Alternately, is there any way to get VS2005 (standard edition) to use the .Net 1.1 compilers/tools?
MSBee[^]
|
|
|
|
|
Thanks!! I was able to get it to build from the command line after a little bit of playing around. It was surprisingly easy to do. But I'll definitely look further at MSBee!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Mr. Jan Dolinay has written an article, "Detecting USB Drive Removal in a C# Program" (http://www.codeproject.com/KB/system/DriveDetector.aspx[^]).
The code works well when I plug and remove a mass storage USB device.
However, when I plug/remove a non-memory storage USB device, (e.g.: a control device), it could capture a WM_DEVICECHANGE message with WParam = DBT_DEVNODES_CHANGED. It never raises DBT_DEVICEARRIVAL message or DBT_DEVICEREMOVECOMPLETE message.
Can anybody tell me how to detect the plug/removal of this kind of USB device?
Thank you.
lk
lk
|
|
|
|
|
Hi,
This might not be the best way of doing it, but it took me all of five minutes to do .... so here goes:
DriveInfo drive = new DriveInfo("F");
if (drive.DriveType == DriveType.Removable)
{
while (drive.IsReady)
{
Thread.Sleep(1000);
}
MessageBox.Show("Drive removed");
}
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r,
Thank you for your reply.
But DriveInfo seems for drive devices, which are mass memory storage device.
For mass memory storage device, we can also use windows message to detect the device plug/remove.
What I need to detect is NOT a mass memory storage device, and hence Windows message doesn't post the device DBT_DEVICEARRIVAL/DBT_DEVICEREMOVECOMPLETE message when I plug/remove it from the USB port. It seems the windows processing is different.
Regards,
lk
|
|
|
|
|
I just did a quick google and came across this[^].
Is it of any use?
|
|
|
|
|
Hey I am looking at the same code that Jan Dolinay has posted and figured as much that it does not detect non-memory storage USB device.
I have a couple of USB Human Interface Devices like microphone, foot pedal etc which I need to detect, was wondering if you figured out how to do it.. It would be great if you would like to share it.
Thanks,
Darsh
|
|
|
|
|
Hi all,
I'm trying to bring one of the tab pages to the fore ground when a user would right click on it. And as silly as this sounds, but I'm struggling. I have tried the following without success.
tabControlMain.TabPages[tabControlMain.SelectedIndex].Show();
Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Your looking for the SelectTab[^] method on the tab control itself
i.e.
this.tabControl1.SelectTab(this.tabPage1);
|
|
|
|