Showing posts with label items. Show all posts
Showing posts with label items. Show all posts

Monday, March 19, 2012

Check db before move items from listbox1 to listbox2 or save them into db

I have two listboxes: listbox1 retrieve rows from tblProfileUsers and listbox2 receive users from listbox1 to save them into the same table tblProfileUsers, but users must have an unique profile associate to him.

So I need that my web form checks if selected users already are on tblProfileUsers and block operation before they saved with a 2nd or 3rd profiles.

I′m using VSTS with SQL 2005.

Check out the SQLExists function.

|||

hi

first you could useselect cout statement to find that user name on those table you want and read the int , if int was 0 it means that there is no such user in that table and you could add that.

for this you could use SqlCommand , SQL connecrtion and SqlDataReaderYes

Thursday, March 8, 2012

Check box in a Combo Box

Hi,
Iam working on a window application using .NET framework 2.0.
I want a check box + some text in a combobox.
User can select multiple items in combo box by using the check
box.
My requirement is : I have a report page. User selects some data
and click on 'Show Report'. Iam showing (I must show) the report also
in the same page. When user selects some other data, and click on 'Show
Report' button new data will be populated.
On this page I have an "Items" Combo box. User may select more than one
Item. Since multi selection property is not there for combo box, Iam
forced to go for ListBox. But Listbox is occupying more space and the
look is bad.
I have seen a CheckedComboBox article here:
http://www.codeproject.com/combobox...&forumid=114...
Its in VC++ I think. I need the same kind of functionality in .NET.
I hope its possible. But dont know how to start with it.
I tried creating a class that is inherited from ComboBox. The class
contains a CheckBox, ItemText Properties. But whats next? Iam unable to
proceed. Could you please help..........
Any ideas or code snippet........ Please............
Regards,
Bharathi Kumar.Please post this to a .Net programming group.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Bharathi Kumar" <bharathidotnet@.gmail.com> wrote in message
news:1149768936.113891.259960@.u72g2000cwu.googlegroups.com...
Hi,
Iam working on a window application using .NET framework 2.0.
I want a check box + some text in a combobox.
User can select multiple items in combo box by using the check
box.
My requirement is : I have a report page. User selects some data
and click on 'Show Report'. Iam showing (I must show) the report also
in the same page. When user selects some other data, and click on 'Show
Report' button new data will be populated.
On this page I have an "Items" Combo box. User may select more than one
Item. Since multi selection property is not there for combo box, Iam
forced to go for ListBox. But Listbox is occupying more space and the
look is bad.
I have seen a CheckedComboBox article here:
http://www.codeproject.com/combobox...&forumid=114...
Its in VC++ I think. I need the same kind of functionality in .NET.
I hope its possible. But dont know how to start with it.
I tried creating a class that is inherited from ComboBox. The class
contains a CheckBox, ItemText Properties. But whats next? Iam unable to
proceed. Could you please help..........
Any ideas or code snippet........ Please............
Regards,
Bharathi Kumar.

Wednesday, March 7, 2012

CHECK ()?

What is best? What is right?
--This way:
---
CREATE TABLE Districts
(
District char(2)
NOT NULL,
Constraint PK_District
Primary Key(District)
)
-- Items Padro --
INSERT INTO Districts VALUES('AC')
INSERT INTO Districts VALUES('AL')
INSERT INTO Districts VALUES('AM')
INSERT INTO Districts VALUES('BA')
INSERT INTO Districts VALUES('CE')
INSERT INTO Districts VALUES('DF')
INSERT INTO Districts VALUES('ES')
INSERT INTO Districts VALUES('GO')
INSERT INTO Districts VALUES('MA')
INSERT INTO Districts VALUES('MG')
INSERT INTO Districts VALUES('MS')
INSERT INTO Districts VALUES('MT')
INSERT INTO Districts VALUES('PA')
INSERT INTO Districts VALUES('PB')
INSERT INTO Districts VALUES('PE')
INSERT INTO Districts VALUES('PI')
INSERT INTO Districts VALUES('PR')
INSERT INTO Districts VALUES('RJ')
INSERT INTO Districts VALUES('RN')
INSERT INTO Districts VALUES('RO')
INSERT INTO Districts VALUES('RR')
INSERT INTO Districts VALUES('RS')
INSERT INTO Districts VALUES('SC')
INSERT INTO Districts VALUES('SE')
INSERT INTO Districts VALUES('SP')
INSERT INTO Districts VALUES('TO')
CREATE TABLE foo
(
...
District char(2),
...
Constraint FK_District
Foreign Key(District)
References Districts(District),
)
--Or this way:
---
CREATE TABLE foo
(
...
District char(2) CONSTRAINT chk_District CHECK (
UF = 'AC' OR
UF = 'AL' OR
UF = 'AM' OR
UF = 'BA' OR
UF = 'CE' OR
UF = 'DF' OR
UF = 'ES' OR
UF = 'GO' OR
UF = 'MA' OR
UF = 'MG' OR
UF = 'MS' OR
UF = 'MT' OR
UF = 'PA' OR
UF = 'PB' OR
UF = 'PE' OR
UF = 'PI' OR
UF = 'PR' OR
UF = 'RJ' OR
UF = 'RN' OR
UF = 'RO' OR
UF = 'RR' OR
UF = 'RS' OR
UF = 'SC' OR
UF = 'SE' OR
UF = 'SP' OR
UF = 'TO')
...
)
ThanksI would go with a foreign key solution as it is more maintainable and a
naatual way to implement referential integrity.
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"ReTF" <re.tf@.newsgroup.nospam> wrote in message
news:uZvY0ugkFHA.2608@.TK2MSFTNGP14.phx.gbl...
> What is best? What is right?
> --This way:
> ---
>
> CREATE TABLE Districts
> (
> District char(2)
> NOT NULL,
> Constraint PK_District
> Primary Key(District)
> )
> -- Items Padro --
> INSERT INTO Districts VALUES('AC')
> INSERT INTO Districts VALUES('AL')
> INSERT INTO Districts VALUES('AM')
> INSERT INTO Districts VALUES('BA')
> INSERT INTO Districts VALUES('CE')
> INSERT INTO Districts VALUES('DF')
> INSERT INTO Districts VALUES('ES')
> INSERT INTO Districts VALUES('GO')
> INSERT INTO Districts VALUES('MA')
> INSERT INTO Districts VALUES('MG')
> INSERT INTO Districts VALUES('MS')
> INSERT INTO Districts VALUES('MT')
> INSERT INTO Districts VALUES('PA')
> INSERT INTO Districts VALUES('PB')
> INSERT INTO Districts VALUES('PE')
> INSERT INTO Districts VALUES('PI')
> INSERT INTO Districts VALUES('PR')
> INSERT INTO Districts VALUES('RJ')
> INSERT INTO Districts VALUES('RN')
> INSERT INTO Districts VALUES('RO')
> INSERT INTO Districts VALUES('RR')
> INSERT INTO Districts VALUES('RS')
> INSERT INTO Districts VALUES('SC')
> INSERT INTO Districts VALUES('SE')
> INSERT INTO Districts VALUES('SP')
> INSERT INTO Districts VALUES('TO')
> CREATE TABLE foo
> (
> ...
> District char(2),
> ...
> Constraint FK_District
> Foreign Key(District)
> References Districts(District),
> )
>
> --Or this way:
> ---
> CREATE TABLE foo
> (
> ...
> District char(2) CONSTRAINT chk_District CHECK (
> UF = 'AC' OR
> UF = 'AL' OR
> UF = 'AM' OR
> UF = 'BA' OR
> UF = 'CE' OR
> UF = 'DF' OR
> UF = 'ES' OR
> UF = 'GO' OR
> UF = 'MA' OR
> UF = 'MG' OR
> UF = 'MS' OR
> UF = 'MT' OR
> UF = 'PA' OR
> UF = 'PB' OR
> UF = 'PE' OR
> UF = 'PI' OR
> UF = 'PR' OR
> UF = 'RJ' OR
> UF = 'RN' OR
> UF = 'RO' OR
> UF = 'RR' OR
> UF = 'RS' OR
> UF = 'SC' OR
> UF = 'SE' OR
> UF = 'SP' OR
> UF = 'TO')
> ...
> )
>
> Thanks
>|||I'd rather store the data in a table. Who wants to go modify a constraint
whenever a district is added or removed?

> What is best? What is right?|||Whatever works best for you. If you think the Districts will change
regularly or if they have to be maintained directly by users then a table is
be the obvious choice. If they'll change less often than you like to make
releases of the database then you can use a CHECK constraint.
David Portas
SQL Server MVP
--

Sunday, February 19, 2012

Chart Color Sequence (Default Palette)

Hi,
Does anyone know where I can get the series color sequence for the
chart generated? For example, if I have 2 items on the chart, the first
one is in green and the next one will be in blue.
Thanks.
-- JordanMost of the provided chart color palettes have 16 distinct colors. As you
have noticed, the default palette always start with green, blue, magenta,
etc.
Every chart series (essentially legend item) gets its own color. The
following blog article shows an example of how to use your own color
palette. It also uses a custom legend that this is probably not what you are
looking for - you could just rely on the built-in chart legend.
http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx
You can also download my sample from the blog article.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jordan" <jordanm@.37.com> wrote in message
news:1119838129.392646.116360@.g43g2000cwa.googlegroups.com...
> Hi,
> Does anyone know where I can get the series color sequence for the
> chart generated? For example, if I have 2 items on the chart, the first
> one is in green and the next one will be in blue.
> Thanks.
> -- Jordan
>|||Hi,
Thanks for your reply. I came across your article and it sort of gives
me an idea on how to achieve my required report format (stacked chart
and line). I am using the default color palette and I need to know the
color sequence so that I can built my own legend to represent the chart
generated. I need to know at least 30 of the first color sequence in
order for my charts and legend to display correctly.
Thanks.
Jordan|||Hello Robert,
I'm running RS SP2 and have long known how to easily specify certain
colors be assigned to specic colors. What I have not figured out is how to
make these programatically assigned series colors semi-transparent like the
default series colors in a stacked bar chart. Is this possible?|||Sorry, semi-transparent colors are not possible through RDL at this point.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian Parker" <BrianParker@.discussions.microsoft.com> wrote in message
news:DD7D9299-87A8-4625-97FF-7178DB004A9A@.microsoft.com...
> Hello Robert,
> I'm running RS SP2 and have long known how to easily specify certain
> colors be assigned to specic colors. What I have not figured out is how
> to
> make these programatically assigned series colors semi-transparent like
> the
> default series colors in a stacked bar chart. Is this possible?