|
|
THX, but i've already tried this solution...else?? THX
Bye
|
|
|
|
|
Can you please provide me a code snippet or link where I can find out how to retrive values from datbase into combo box ?
Thanks
|
|
|
|
|
You get the values from the database, then make the data set you get back the data source for 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 )
|
|
|
|
|
Thanks Christian but I tried doing what you said let me just copy paste my code
DataSet ComboboxLicencegrpID;
ComboboxLicencegrpID = CombolicencegrpID();
this.LicensegrpIDBox.DataSource = ComboboxLicencegrpID.Tables["comboLicenseGroupID"];
public DataSet CombolicencegrpID()
{
SqlCommand cmd = new SqlCommand();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select Name,LicenseGroupID from webqa_state.dbo.METADATA_LicenseGroups";
cmd.Connection = DBConnection.getConnection();
da.SelectCommand = cmd;
da.Fill(ds, "comboLicenseGroupID");
return ds;
}
Its giving me an outputlike this :-
In the Combobox all values are the same and its "System.Data.DataRowView"
What can be the problem ???
|
|
|
|
|
Sorry, I missed a step. There's a property you set to tell it what property to read out of each data item, such as a row name. Otherwise, it displays the ToString of the object. I think it's DataTextField or something.
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 )
|
|
|
|
|
It worked I have to use this which i was missing
combobox.Displaymember = "Name";
combobox.Valuemember = "Name";
Thanks !
|
|
|
|
|
*grin* that's it. I think the property I told you was the one for web forms, sorry.
Value member does not need to be set, unless you want to set a value, usually an Id, not a 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 )
|
|
|
|
|
I am able to retrive the values but I have to display in the combo box like this "Name[UserID ]"
sam[1003]
dan[2003]
If I am writing as below, It will diplay any one of these ..
combobox.Displaymember = "Name";
combobox.Valuemember = "Name";
combobox.Displaymember = "userID";
combobox.Valuemember = "userID";
What should you think I should do to get the desired result ???
|
|
|
|
|
you need to add a new column which contains the data in the format you want to display it. You can't format a value directly from multiple fields.
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 )
|
|
|
|
|
I did not get it if possible can you provide me some code or little more detail. I tried this
while fetching the Data I Pass the Querry Like that
"Select ID,('['+ID+']'+EnpName) As FullDeatils form Emp"
Then while DataBinding, just Give like that
combobox.Displaymember = "FullDeatils ";
combobox.Valuemember = "ID";
now
Its giving an SqlException stating "Conversion failed when converting the varchar value '[' to data type int "
|
|
|
|
|
Was able to solve actually had to cast it
select '['+CAST(ID As varchar(20))+'] '+Name As FullDetails from Emp
Resolved
|
|
|
|
|
iam declaring property in one class and using this property i want to
get a value from one page and set it to other page iwant an example code.
with regards
priya
priya
|
|
|
|
|
I suspect that your use of the word 'page' means you meant to ask this in the ASP.NET forum.
You can't get values from pages, only the page you're viewing exists on the server, and only just before the client sees it. you can pass values between URLs using the querystring
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 )
|
|
|
|
|
So, I have IE hosted in a windows app. This app adds functionality to a website ( long story ). So, the website has an area for typing reports. The people generating reports, use Dragon Naturally Speaking.
In IE, they can double click on a word and can type to replace it, or speak to replace it. In my program, they can double click on a word and it selects. They can press delete to delete the word. If they type ( or speak ) it doesn't work. If they scroll to highlight the word, then it works, but not if they double click.
Does anyone know what's happening here ?
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 )
|
|
|
|
|
Are you sure it's not losing focus for some ungodly reason? It could explain why it's not working properly.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I thought it may be a focus issue, and perhaps it ultimately is, but what weird focus state means you have highlighted a word, the delete key deletes it, but other keys don't work ?
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 )
|
|
|
|
|
Right, yeah *scratches head*
I do know of one other situation where stuff doesn't work properely in IE, here at CP. When I post messages, occasionaly the shortcut Ctrl+V doesn't work and i have to right click - paste instead, also sometimes the backspace or delete key will not work, I forget which. So it could just be some crazy stuff with IE although lets hope not
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Well, the crazy thing is, it works fine in IE, until it's embedded in my app. That's the point at which it's assumed to be MY problem.
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 )
|
|
|
|
|
I think it's IE gets screwed up when it is hosted by another application. For example if you use this[^] to host IE, you won't be able to navigate to another website.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Yeah, that seems to me to be the case. I am just hoping there's a way around it. Sadly, googling 'internet explorer host keyboard focus' gives me a lot of useless stuff.
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 )
|
|
|
|
|
Hi All!
I've been trying to port my apps from VS6 to 64 bit.
When I use serialization to write classes to fie - what should be a 27mb data file becomes 459mb!
And it runs S-L-O-W.
There are no methods (functions) in the classes. Just data.
The data file was created the (EASY) old way by writing structs to a binary file.
I also tried that "marshall" thing - what a joke!
So, my question is how in the world do you write structs or classes to a file without tons of overhead?
I know I can use C++ native code but surely there must be a better way.
If not, can native code be compiled to 64 bit?
thanx for any responses
bigchump
|
|
|
|
|
bigchump wrote: I've been trying to port my apps from VS6 to 64 bit.
One has to ask if you're porting to C#, or if you're just lost ?
bigchump wrote: If not, can native code be compiled to 64 bit?
Yes.
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 )
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">Christian Graus wrote:</div>One has to ask if you're porting to C#, or if you're just lost ?</blockquote>
I've ported everything to C# and am generally pleased.
My business requires me to write my own programs.
I've been doing it for over 20 years using C and assy.
But I'm not any kind of expert and need some answers in plain English.
The help screens in VS8pro are virtually worthless to me. I don't understand the jargon AT ALL.
Never liked C++ and don't want to use it *IF* I don't have to...
It's really annoying to have my 32 bit machine run circles around my 64 bit stuff.
So back to my question, is it possible to create a custom database with C# that is compact and runs fast?
thanx
bigchump
|
|
|
|
|
bigchump wrote: So back to my question, is it possible to create a custom database with C# that is compact and runs fast?
Wow - I didn't get that this was your question at all.
Why would you use a custom database ? SQL Server Express is free, there's an edition that actually embeds the DB in your app, or you can still use an Access MDB database. They will all run fast enough for most applications.
you can set the compiler to build 64 bit, but in C#, the default setting is for both, b/c the framework itself builds your final exe, unless you need to write 64 bit specific code, that seems the best option to me. In fact, I have found the only reason to specify 32 or 64 is to specify 32 to force 32 bit compatibility mode if needed.
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 )
|
|
|
|