|
As per my knowledge, Do this.
Make the data source(Table containing the Cities) of Combobox, publicly accessible by declaring in the mainForm a static propertly which return the data table of cities.
In the dialog box, where you add new record, access the data table of mainForm and add city in it. It'll automatically shown in combo box because its already bound to that table.
Regards
|
|
|
|
|
thanx for answer
appreciate
|
|
|
|
|
Since C# 3.0 natively supports LINQ in the language wouldn't that make the ADO.NET stuff part of the CLR and BCL?
|
|
|
|
|
Why would LINQ change ADO.NET ?
Christian Graus - Microsoft MVP - C++
"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 there,
I have a stored procedure written on a RichTextBox. On the click of a button, this stored procedure should be executed and errors, if any, should be displayed in a messagebox.
Thanks in advance!
|
|
|
|
|
Hi!
You can access the text in the RTB via its Text property (I can't see what else this has to do with the topic).
To execute a SP with a given name you can use classes from the System.Data.* namespace, depending on the RDBMS you want to use, for example the SqlCommand class.
There's a ton of samples for this on MSDN for example, try googling for it if you still have troubles.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks mav,
Currently I am using this option. The problem is that SqlCommand class can handle only one SQL command at time. What I need is to send an entire SP, execute it and after the whole SP is executed in "one go";
1. If successful, a message box saying "Successful Execution" should be displayed; else,
2. Whatever exception has been returned, that needs to be displayed.
|
|
|
|
|
You can't "send an entire SP". A SP is something stored within the DB (hence the name). You _could_ execute an SQL command containing something like "CREATE PROCEDURE ..." to create a SP on-the-fly, but I think that's not a good solution.
If you have several queries you have to execute together, then the SP should be available in the DB, not be created everytime, IMO.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
the Pronblem is i have a table of employeeinfo having attribuyes
EmpID
EmpName
EmpFatherName
GenID
now GenID is a primary key of a separate table having two attributes that is
GenID
Gender
the problem is when the form runs displaying 3 textboxes and one combobox the user must select the entry from gender and click save the values must be stored in the table of sql that is Employeeinfo i saved the first three attributes by the following code
datarow.["EmpID"] = EmpID.text;
but on GenID it gives problem bcoz i want to relate the Gender attribute to the GenID Attribute in the EmployeeInfo table and must be saved in the sql data table
SAS
|
|
|
|
|
Make the combo boxe's Display Member property to Gender and Value Member property to GenID. when assigning the values to employeeinfo use like this
datarow.["EmpID"] = EmpID.text;
.
.
.
datarow.["GenID"] = comboBox.SelectedValue;
Regards
|
|
|
|
|
Hi All,
After constructing a string from a byte[], is it possible to call a static method (I'm pretty sure ther is no memeber method) such as IsPrintable( <string> )? I would expect we would pass in a certainy or threshold value. Or is this one of those 'roll your own' implementations?
Jeff
|
|
|
|
|
Hi!
Of course it is possible to call a static method, but since System.String doesn't offer a static method doing what you want, you'll have to "roll your own".
I guess you could use static methods of System.Char for this (e.g. Char.IsControl() ).
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
hi
I will open the word file with C#2005 but print content file with c#2005
please help meeeeeeeeeee
tanks a lot
|
|
|
|
|
Cannot really be done without the help of the Office Interop Library.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi
I will open the word file with C#2005 but print content file with c#2005
please help meeeeeeeeeee
tanks a lot
|
|
|
|
|
|
hi there,
i insert binding navigator and bind it to combobox items like this
BindingSource bindingSource = new BindingSource();
bindingSource.DataSource = combobox.Items;
bindingNavigator1.BindingSource = bindingSource;
and its working but it have a problem that when i select any item in combobox then its position dont increase.
to do that i tried to just assign the "selectedindex + 1" of combobox to its position textbox's text in SelectedIndexChanged event
and its shows correct position but its not actual, that mean it just showing, not working
for example
i have 3 items in combobox, and i select 3rd item then it will show position is 3 but the last and next buttons still enabled and first and previous still disabled.
any idea to solve it?
thanks
Becoming Programmer...
|
|
|
|
|
Have you tried the Refresh method?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
yeah, but it didnt work
Becoming Programmer...
|
|
|
|
|
|
Downloaded it and looks pretty cool.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello,
I have been trying to render an SVG file on a form, but I can't seem to get it right. The main thing I need is to get SVG files onto the main form, and the possibility to scale them without loss of quality. I have been trying some things with Svg.Net, but to no avail.
Maybe I am missing a really obvious thing, but I would sure appreciate it if someone could give me some pointers.
Thanks in advance!
Kind regards,
Johnny
|
|
|
|
|
The really obvious thing to me would be to put a browser control in your form and let it render the SVG ?
Christian Graus - Microsoft MVP - C++
"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, that would be a good idea, but we need to render and scale icons for Points Of Interest for a route navigation application ourselves. We also need to scale those icons dynamically. Drawing the map is done in a PictureBox, so a browser control is really not an option.
|
|
|
|
|
Hi All,
I wanted to share this with anyone who may stumble across this thread.
X.690 specifies a BMP string is the 2-octet canonical form (specified in ISO/IEC 10646-1) [1] of UCS (also specified in ISO/IEC 10646-1) [2]. Note that ASN.1 does not include an "Endianness" marker in its octet stream [3].
ISO 10646 prefers Big Endianness, though it is not standardized [4]. According to Microsoft, CodePage 1200 is Unicode (UTF-16), and CodePage 1201 is Unicode Big Endian (16 bits also)[5].
In memory, the byte[] from the ASN.1 sequence is [00 77 00 105 00 99 00 114 00 111 00 115 00 111 00 102 00 116 ...]. This is a Big Endian Serialization [6] from Microsoft's Cryptograhic Service Provider.
When interpreted as Unicode, I receive a non printable string. When interpreted as Big Endian Unicode (CodePage 1201), I receive 'Microsoft'.
So, a test of byte[] (Value[0]) is required to properly return the string. The return will be either Encoding.GetEncoding(1200).GetString(Value); or Encoding.GetEncoding(1201).GetString(Value).
Simply using Encoding.Unicode does not produce expected results in every case, since Unicode implies Little Endianness when using C#.
Jeff
[1] ITU X.690, p. 16, Section 8.21.8
[2] ITU X.690, p. 16, Section 8.21.9
[3] ITU X.690, p. 16, Section 8.21.9. Note 2b.
[4] ISO-10646, Section 6.3
[5] EncodingInfo Class[^]
[6] RFC 2781, Section 3.1
|
|
|
|