|
I do not have a datasource. All I know is that I have a connection to the database and i know the select statement i need to put into the code.
|
|
|
|
|
Then when you call the SQL, you'll have a dataset. Which is a datasource.
So is an array, as it happens.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can you show me an example of this so I can have a better idea.
|
|
|
|
|
I'm kind of confused. You have SQL, but you don't know how to use it to get info into C# ? Have you done any research ? Is it a SQL Server DB ? Do you know how to create a connection string ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
precado999 wrote: I don't think I need to add columns in code
I think u need to add column the to display the data from the Database.
Set the listview property to details. Then add columns
lyk:- listview.Columns.Add("Heading", width, allignment)
same for another column you want to add.
then create a datatable from database with the data u want, in ur case ID, FName, LName.
Loop thru the rows to show the data.
foreach(DataRow dr in dt.rows)//here dt is for datatable
{
listview.Subitems.Add(dr["ID"].tostring());
//same for Fname,
//& so on.....
}
The code here here is not syntactically correct.
Hope this will help you.
|
|
|
|
|
hello, id like to run console program from C# gui and catch its output and i have a problem that text in console is bigger than standard console width. is there a way how to set console width in C# for that process ?
maybe there is option in process.StartInfo how to use console with bigger width than standard 80 chars?
|
|
|
|
|
Hi,
I don't know you can do that programmatically, but maybe this helps: you can set it
manually by right-clicking the console window title, change window size and buffer size,
then save choosing "save for all windows with same title".
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
thank you for reply
i already found this but it didnt help and it still cuts characters that dont fit in standard width
|
|
|
|
|
dwrst wrote: it still cuts characters
I don't think so. I just ran it with a width of 170 characters, and it works great.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
really? and you launched it as process (external application) and you can read 170 characters per line from it? because it doesnt work for me.. so maybe the problem is in stream reader? im using this code http://www.codeproject.com/KB/threads/launchprocess.aspx
|
|
|
|
|
Hi,
no, sorry, it is a console app that outputs to a wide console it owns.
if the app is an existing app it may have its own limitations, and/or it may assume
its console is 80 char wide.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I dont think u can set width standard console window in C#, but may be can by C++.
|
|
|
|
|
System.Console has a number of methods (and properties) that may help
SetWindowSize
WindowHeight
WindowWidth
LargestWindowHeight
LargestWindowWidth
But, as Luc said, the app may break lines before the edge of the window.
|
|
|
|
|
Does anyone know how can I possibly update or refresh a combobox that's on another form (or how can I update this form)?
|
|
|
|
|
Is the form part of your project ( I expect not ) ? You can get the handle of the combo box and send it WM_ messages, but it sure is nasty, I would not recommend it
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The form is a part of my project.
I have two forms. One is MainForm, and on it is a databind combobox. There is also a button, and when the user clicks it, it takes him to another form where he can enter some new information and add those information to a datasource to which my combobox is connected to. That information should then be displayed in combobox, but I need to refresh it first, and I have no idea how to do that.
|
|
|
|
|
Ah, OK. Now I understand the question, use a delegate to inform your main form that an event on the subform means it needs to refresh the combo box
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok, thanks
|
|
|
|
|
Hello all.
I'm designing a small app that takes a bitmap image as an input, compares it to a database of images, and returns the image it is most similar to.
The matches will not be exact (i.e. they may be of the same subject but at a slightly different angle, zoom, etc.).
What I'd like to know is what aspect of the image you'd suggest to use for this comparison (binary image pixels, histogram, etc.) and how to make a match when the images will not be exact copies.
I'm coding this in C# and any code specific answers would be appreciated as well.
Thanks.
- Alex
|
|
|
|
|
There's a free C# library that does image recognition and motion detection, among other things. The library is called AForge.NET[^]. Perhaps it will help you detect image similarities.
|
|
|
|
|
Thanks Judah. I will check that out.
|
|
|
|
|
Can anyone tell me how I can detect if an item is added/removed/changed in a listbox/combobox? As far as I can see there are no events raised when these changes occur, at least if it does not happen to a selected item.
|
|
|
|
|
yeah, you have to do this yourself, i do this in 2 ways, if i use lots of combobox in my app then i make a component class, inherit the combobox, make my own method that will add the items as well as raise an event too
2nd is useless infront of 1st, it can be use when i have one or 2 combobox
i call my desired method after Add() or Remove() to update it
i hope it will help
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
i add new database from add new item in visual studio 2005 and trying to insert data in table, i checked connection string, query every thing, but when i press insert button to add data it dont give me any error nor any data is inserted.
PLZ HELP ME
asd
|
|
|
|
|
Wow - what do you expect us to do for you based on that ? How are you trying to insert data ? What sort of database ? What is the connection string ?
For starters, I recommend reading the 'how to ask questions' sticky on the top of the forum.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|