To Display Two Values In Combobox But In Database Will Store Only One Value Out Of That

Jan 24, 2008



hi friends
i am using visual studio 2005. i need one combo box which will display two values. one is "Designation" i.e.("clerk,accountant,manager,officer,shopkeeper) and another "Designation ID" i.e.(1,2,3,4,5 and respectively) i made table of "Designation Master" in sql server 2000 including field of "Designation ID, Designation". manually i am inserting id and designation in that table.
what i want exactly i have one customer form which contain a "combobox" for "Designation" column i achieved "Designation ID" and "Designation" in that combo box also but when i will go for save i want that i will store only "Designation ID" i don't want to store "Designation" in my "Designation" column which is in "Customer table" i am attaching code which store "Designation ID" and "Designation" in customer table but i want only "Designation ID" only
bold line which is difficult for me to inserting only "designationId" in customer table.




Inventory_Master.cntData.Open()

cmdstr = "Select DesigID,Designation from Designation_Master"

cmd = New SqlCommand(cmdstr, Inventory_Master.cntData)

cdrCustomer = cmd.ExecuteReader()

If cdrCustomer.HasRows = True Then

While cdrCustomer.Read()

cmddesig = cdrCustomer.Item(0).ToString.PadLeft(1) + cdrCustomer.Item(1).ToString.PadLeft(25)

cbodesignation.Items.Add(cmddesig)

End While

Else

End If

Inventory_Master.cntData.Close()



Inventory_Master.cntData.Open()

cmd = New SqlCommand("insert CUSTOMER(Membership_No,Member_Initial,Member_Name,Member_Birthdate,Gender,Res_Telno,Mobile_No,Res_Addr1,Res_Addr2,Res_City,Res_Pincode,Landmark,Company_Name,Comp_Addr1,Comp_Addr2,Comp_Telno,Comp_City,Comp_Pincode,Designation,Credit_Limit,Income_Mthly,Email_ID,Note) values (@Membership_No,@Member_Initial,@Member_Name,@Member_Birthdate,@Gender,@Res_Telno,@Mobile_No,@Res_Addr1,@Res_Addr2,@Res_City,@Res_Pincode,@Landmark,@Company_Name,@Comp_Addr1,@Comp_Addr2,@Comp_Telno,@Comp_City,@Comp_Pincode,@Designation,Convert(money,@creditlimit),@Income_Mthly,@Email_ID,@Note)", Inventory_Master.cntData)

cmd.Parameters.AddWithValue("@Membership_No", txtmebno.Text)

cmd.Parameters.AddWithValue("@Member_Initial", cbomebname.Text)

cmd.Parameters.AddWithValue("@Member_Name", txtmebname.Text)

cmd.Parameters.AddWithValue("@Member_Birthdate", dtime.Value)

cmd.Parameters.AddWithValue("@Gender", cbogender.Text)

cmd.Parameters.AddWithValue("@Res_Telno", txttelno.Text)

cmd.Parameters.AddWithValue("@Mobile_No", txtmobileno.Text)

cmd.Parameters.AddWithValue("@Res_Addr1", txtresaddr1.Text)

cmd.Parameters.AddWithValue("@Res_Addr2", txtresaddr2.Text)

cmd.Parameters.AddWithValue("@Res_City", txtrescity.Text)

cmd.Parameters.AddWithValue("@Res_Pincode", txtrespin.Text)

cmd.Parameters.AddWithValue("@Landmark", txtlandmark.Text)

cmd.Parameters.AddWithValue("@Company_Name", txtcompname.Text)

cmd.Parameters.AddWithValue("@Comp_Addr1", txtcompaddr1.Text)

cmd.Parameters.AddWithValue("@Comp_Addr2", txtcompaddr2.Text)

cmd.Parameters.AddWithValue("@Comp_Telno", txtcomptelno.Text)

cmd.Parameters.AddWithValue("@Comp_City", txtcompcity.Text)

cmd.Parameters.AddWithValue("@Comp_Pincode", txtcomppin.Text)

cmd.Parameters.AddWithValue("@Designation", cbodesignation.Text.PadLeft(1, CChar(CStr(1)))) [ help me for inserting designation in this line]

cmd.Parameters.AddWithValue("@creditlimit", txtcreditlimit.Text)

cmd.Parameters.AddWithValue("@Income_Mthly", txtincomemthly.Text)

cmd.Parameters.AddWithValue("@Email_ID", txtemailid.Text)

cmd.Parameters.AddWithValue("@Note", rtxtNote.Text)

cmd.ExecuteNonQuery()

Inventory_Master.cntData.Close()

MsgBox("RECORD SAVED")


View 1 Replies


ADVERTISEMENT

One Combobox And Different Database Tables

Mar 17, 2008

I have a data-driven application with 2 Comboboxes on a VB 2005 form and and SQL Server 2005 database. I am looking to get a solution when the user, select say ACCOUNTS on Combobox1, I would like Combobox2 to get filled with the Accounts staff in the ACCOUNTS table in the database and when SALES is selected on Combobox1, Combobox2 is filled with Sales staff in the SALES table etc. I have 10 database tables in all to interchange with on Combobox2. Thanks

View 12 Replies View Related

Want To Store Arabic Values In The Sql Server Database

Feb 27, 2008

Hi,

I want to store arabic values and dates in sql server database.

I am using visual basic 2005 with sql server 2005. I entered the the arabic values through visual basic forms. But when i open the database table, i see the values in english format.

I change my regional settings of the operating system is arabic (platform vista).

Can you give how to see arabic values.

Thanks.


Regards
Kashif Chotu

View 3 Replies View Related

Store Into Database Report Parameters Values?

Feb 3, 2007

Hallo
is it possible to perform an insert/update query upon the execution of a report, using the report Visual Basic expressions?
I mean, the user enters some values for the report parameters, and i would like to store them, along with the resulting recordset data, into a dedicated table in the database.

View 1 Replies View Related

Display A Message In Store Procedure

Sep 10, 2007

 helo all..., this is my store procedure. but it can not display message. my friend said it must use output code. can someone add output code to my store procedure, so it can display message?ALTER PROCEDURE [bank].[dbo].[pay]( @no_bill INT, @no_order int, @totalcost money, @message varchar(100) -- make it output parameter in your stored procedure)ASBEGIN TRANSACTION DECLARE @balance AS moneyselect @balance = balancefrom bank.dbo.billwhere no_bill = @no_billselect @totalcost = totalcostfrom games.dbo.totalcostwhere no_order = @no_orderif (@balance > @totalcost)beginset @balance = @balance - @totalcostUPDATE bank.dbo.bill SET [balance] = @balance WHERE [no_bill] = @no_bill-- set @message = 'your have enough balance'endelsebeginset @message = 'sorry, your balance not enough'endCOMMIT TRANSACTIONset nocount off  pls.., thx 

View 13 Replies View Related

T-SQL (SS2K8) :: Create Union View To Display Current Values From Table A And All Historical Values From Table B

May 6, 2014

I have 2 identical tables one contains current settings, the other contains all historical settings.I could create a union view to display the current values from table A and all historical values from table B, butthat would also require a Variable to hold the tblid for both select statements.

Q. Can this be done with one joined or conditional select statement?

DECLARE @tblid int = 501
SELECT 1,2,3,4,'CurrentSetting'
FROM TableA ta
WHERE tblid = @tblid
UNION
SELECT 1,2,3,4,'PreviosSetting'
FROM Tableb tb
WHERE tblid = @tblid

View 9 Replies View Related

Store English Language , But Want To Display In Mandarin/arabic Words

Sep 24, 2007

hye everyone,
i am new in reporting service and have question about :

if my table in database store the english words but want to display in chinese/ arabic on my report.
so..can the reporting service do like that..
any suggestion/tips or idea...

thanks in advance
thank you very much

View 2 Replies View Related

Display Of Variable Values

Sep 23, 2004

Hello Experts:

I want to access the values coming from the table but my code is just printing the varibale name.

e.g. It is printing right now

@lev0
@lev1
@lev2
@lev3
@lev4

but infact in variable @lev1, the actual value from table is [prodcut]. the value in varibale @lev1 is [category].

Can you pl. help me?

--- My code

Declare

@lev0 varchar(50),
@lev1 varchar(50),
@lev2 varchar(50),
@lev3 varchar(50),
@lev4 varchar(50),
@stmnt varchar(2000),
@counter int,
@st varchar(50)

Select @lev0=Dimnsion, @Lev1= Lev1, @Lev2= Lev2, @Lev3= Lev3, @lev4= lev4 from dbo.Lookup where dimnsion = '[Product]'
Set @counter = 0

while @counter < 5
begin
set @st = '@lev'+cast(@counter as varchar(50))
print @st
set @counter= @counter+1

end

-------

Thanks

View 1 Replies View Related

Pick And Display TOP 3 Values

May 18, 2014

I have the below data with two columns (Posting Date and Pond Crop, construct an SQL where i will pick and display only the TOP 3 Posting date of EACH Pond Crop. I only attached less data but in reality there are lots of Ponds and posting date in this table.

Table Name : Weekly Harvest

Fields:
1. Posting Date
2. PondCrop

Desired Output:

Posting Date PondCrop
2011-12-12 00:00:00.00001PA01-15
2011-12-19 00:00:00.00001PA01-15
2011-12-26 00:00:00.00001PA01-15
2012-03-19 00:00:00.00001PA01-16
2012-03-20 00:00:00.00001PA01-16
2012-03-26 00:00:00.00001PA01-16

Raw Data
Posting Date PondCrop
2011-11-21 00:00:00.00001PA01-15
2011-11-28 00:00:00.00001PA01-15
2011-12-02 00:00:00.00001PA01-15
2011-12-05 00:00:00.00001PA01-15

[Code] ....

View 7 Replies View Related

Display Minimum Of Two Values

Apr 13, 2015

I want the minimum of two values to be display like below without using the case

MIN(3.00,4.00)

output:

3.00

View 2 Replies View Related

Row Values Display In Columns

Jun 5, 2015

One Table have 2 Columns.

1.Order_number
2.PSON NUmber

In Table Contains 6 rows with 2 order_numbers and different PSON Number.I want Order Number,PSON1,PSON2,PSON3,PSON4 and its Values

Ex:--Order_number    PSON NUmber
             1                    ONT10
             1                    ONT11
              1                   ONT12
              2                   ONT13
               2                   ONT14

I want   data :-      Order_number    PSON1          PSON2        PSON3
                                  1                     ONT10      ONT11       ONT12
                                   2                      ONT13     ONT14       Null

View 3 Replies View Related

Display Null Values

Jul 17, 2007

Hello,



I'm facing a problem in my reporting.

I have a Customer table where is record various events like CustomerEventId, DateTime, StatusId, StatusTime, GroupId, ...

I also have a status table (Id, Description) and a group table (Id, Description).



I want to create a report where for a selected date range (From ... To ...) i can see (grouped by date) all status's the customer

went in. The possible status are :

Id Description

-------------------------------------

1 status 1

2 status 2

3 status 3

4 status 4



My query looks something like this :



SELECT CustomerEventId, DateTime, CONVERT(varchar, DateTime), 103) AS DATEVAL, StatusId,

status.description as StatusDescription, StatusTime, GroupId, group.Description as GroupDescription

From Customers inner join status on customers.StatusId = status.id

inner join group on customers.GroupId = group.id

Group By CustomerEventId, DateTime, StatusId, status.description, StatusTime, GroupId, group.Description



My reports has 3 parameters (From date, To date, Group)

In my report i have a table with two groups : GroupByDate (grouped on DATEVAL) and GroupByStatus



now my problem : let's say i have values for statusid 1,2 and 4

then my report will only display those 3 status.

How can i display the status where there is no data for :

now it shows :

DATEVAL Occurrences Time

01/07/2007

Status 1 15 125

Status 2 25 366

Status 4 8 66

I would like it to show:

DATEVAL Occurrences Time

01/07/2007

Status 1 15 125

Status 2 25 366

Status 3 0 0

Status 4 8 66



Anybody (i hope i have provide enough details ...)



Vinnie

View 1 Replies View Related

Display Null Values

Apr 17, 2007

Hi,



I have the following problem.

I have created different tables in my database with descriptions in from other tables (example : a table named errors with errorid and errordescription as fields in it)

In a report i want to display the total nr of errors during a certain period for a certain department.

i have created that report with a list (by department). in this list i have a table where i group my errors.

until here all ok. when i display my report it shows all the errors.

but what it doesn't show is all the errors who have value 0 (or errors that didn't occur during that period i defined)



how can i display all my errors, even if they did not occur (0 times)



Greetings

vinnie

View 3 Replies View Related

Query To Display Max Values For Each ID

Jun 5, 2015

I have table that contains below data

Date                              ID            
Message
2015-05-29 7:00:00      AOOze            abc
2015-05-29 7:05:00      AOOze            start
2015-05-29 7:10:00      AOOze            pqy
2015-05-29 7:15:00      AOOze            stop
2015-05-29 7:20:00      AOOze            lmn     

[code]....

and so on following the series for every set of different ID with 5 entries.I need to Find Maximum interval time for each ID and for condition in given message (between Start and Stop)For example, in above table

-For ID AOOze, in message "start" is logged at 7:05 and stop and 7:15, so interval is 10 mins
-For ID LaOze, in message "start" is logged at 7:30 and stop and 7:45, so interval is 15 mins

I am looking for a sql query that will return in below format

ID     MAX interval
AOOze   15
LaOze   10

View 15 Replies View Related

Uniqueidentifier And Combobox

Nov 26, 2007

Hello all,
I would like to put another line into my combo box using this SQL statement but this part "(select newid() as QuestionID, 'Select a Question' as QuestionText)" is not working.   (select newid() as QuestionID, 'Select a Question as QuestionText) union all (SELECT * FROM (SELECT TOP 100 * FROM [dbo.aspnet_Questions]) as tbl)
RETURN
It gives me an error: Invalid object name 'dbo.aspnet_Questions'.  Can anybody please help me with this error? 
Thank you, Vic. 

View 5 Replies View Related

Combobox Width

Oct 2, 2007

Hello,

How can I change the width of my comboboxes etc in SQL Enterprise Manager ?

I can't see which table I'm supposed to be updating and it's causing me huge problems.
(basically my fields are called things like Staging_EmployeeDetails etc)

I'm on a 17" monitor with a resolution of 1280 x 1024 so this shouldn't be an issue, and all screens are maximized.

I've tried dragging the corners of the window, but it doesn't seem to let me.

As an example, I'm in the export wizard and I can't tell which rowto use when I query the data (See screenshot)

View 1 Replies View Related

Filter Using A Combobox

May 13, 2006

Hello everyone,

I am working on a filter function for my sql database (C#), and am running into a bit of difficulties, and I thought I'd ask if someone can see something wrong with my code.

In my program, I basically have 3 comboboxes: gendcombo, agecombo, and regioncombo. I have filled them (except region) with search criteria (I want to get the other two working first). When I hit the OnRunFilterBtn, I would like to load the filtered criteria into the ListView... which is composed of 5 items: ID, Title, Text, Age, Gend.

I'm not sure where I am going wrong with this one, and any direction would be helpful. I initially tried to load the columns (age, for example) into the combobox, but that didn't seem to want to work for me, so I went ahead and added it myself. I then tried to change the

string strSQL = "SELECT ca_titel, ca_alter, ca_sex FROM fragenkatalog";

to

string strSQL = "SELECT * FROM fragenkatalog";

which didn't work either.

I basically believe that I am either not filtering all of the columns of the database (i.e. only the three of them) and can't spit them into the listview, or that my strSQLFilter line is foul. Either way, I'm not sure what to do about it, and therefore would be very grateful for your help,



Thanks again,





Martina



Here's the code, if it helps. If I have not provided enough, please let me know. :)

Thanks,

M.

// agecombo

//

this.agecombo.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);

this.agecombo.Items.Add("");

this.agecombo.Items.Add("0");

this.agecombo.Items.Add("1");

this.agecombo.Items.Add("2");

this.agecombo.Items.Add("3");

this.agecombo.Items.Add("4");

this.agecombo.Items.Add("5");

this.agecombo.Items.Add("6");

this.agecombo.Items.Add("7");

this.agecombo.Items.Add("8");

this.agecombo.Items.Add("9");

this.agecombo.Items.Add("10");

this.agecombo.Items.Add("11");

this.agecombo.Items.Add("12");

this.agecombo.Items.Add("13");

this.agecombo.Items.Add("14");

this.agecombo.Items.Add("15");

this.agecombo.Items.Add("16");

this.agecombo.Items.Add("17");

this.agecombo.Items.Add("18");

this.agecombo.Items.Add("999");

this.agecombo.Location = new System.Drawing.Point(48, 16);

this.agecombo.Size = new System.Drawing.Size(80, 21);

//

// regioncombo

//

this.regioncombo.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);

this.regioncombo.Location = new System.Drawing.Point(48, 40);

this.regioncombo.Size = new System.Drawing.Size(80, 21);

//

// gendcombo

//

this.gendcombo.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular);

this.gendcombo.Items.Add("");

this.gendcombo.Items.Add("m");

this.gendcombo.Items.Add("f");

this.gendcombo.Items.Add("n");

this.gendcombo.Location = new System.Drawing.Point(48, 64);

this.gendcombo.Size = new System.Drawing.Size(80, 21);

//



private void OnRunFilterBtn(object sender, System.EventArgs e)

{

// the filter criteria

//ca_titel is for regioncombo, ca_alter is for agecombo, ca_sex is for gendcombo

string strSQL = "SELECT ca_titel, ca_alter, ca_sex FROM fragenkatalog";

string strSQLFilter = "";

if ( (int)gendcombo.SelectedIndex > 0 )

{



if ( strSQLFilter.Length > 0 )

{

strSQLFilter += " AND ";

}

strSQLFilter += "ca_sex = " + gendcombo.SelectedIndex.ToString();

}

if ( (int)agecombo.SelectedIndex > 0 )

{

if ( strSQLFilter.Length > 0 )

{

strSQLFilter += " AND ";

}

strSQLFilter += "ca_alter = " + agecombo.SelectedIndex.ToString();

}

if ( (int)regioncombo.SelectedIndex > 0 )

{

if ( strSQLFilter.Length > 0 )

{

strSQLFilter += " AND ";

}

strSQLFilter += "ca_titel = " + regioncombo.SelectedIndex.ToString();

}

LoadList(strSQL);

}

View 4 Replies View Related

How To Display The Values From Two Different Columns (was RS Question)

Jan 3, 2008

Does somebody know how do you get a column in Reporting Services to display the values from two different columns? I don't mean a concat, but the result of the two columns.

This has been a headache for 2 days now.

Thanks!!

View 3 Replies View Related

Need To Store Duplicate Values To DB

May 7, 2007

Hi,I have written a stored procedure to store values from a report i generated to the DB. Now there is a column PKID which is the primary key but also needs to be repeated at times. I tried to clear the memory that the same PKID has already been entered for which I wrote another SP.  SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[spCRMPublisherSummaryUpdate](    @ReportDate smalldatetime,    @SiteID int,    @DataFeedID int,    @FromCode varchar,    @Sent int,    @Delivered int,    @TotalOpens REAL,    @UniqueUserOpens REAL,    @UniqueUserMessageClicks REAL,    @Unsubscribes REAL,    @Bounces REAL,    @UniqueUserLinkClicks REAL,    @TotalLinkClicks REAL,    @SpamComplaints int,    @Cost int)ASSET NOCOUNT ON    DECLARE @PKID INTDECLARE @TagID INTSELECT @TagID=ID FROM Tag WHERE SiteID=@SiteID AND FromCode=@FromCodeSELECT @PKID=PKID FROM DimTag WHERE TagID=@TagID AND StartDate<=@ReportDate AND @ReportDate< ISNULL(EndDate,'12/31/2050')IF @PKID IS NULL BEGIN    SELECT TOP 1 @PKID=PKID FROM DimTag WHERE TagID=@TagID AND SiteID=@SiteIDDECLARE @LastReportDate smalldatetime, @LastSent INT, @LastDelivered INT, @LastTotalOpens Real, @LastUniqueUserOpens Real, @LastUniqueUserMessageClicks Real, @LastUniqueUserLinkClicks Real, @LastTotalLinkClicks Real, @LastUnsubscribes Real, @LastBounces Real, @LastSpamComplaints INT, @LastCost INT SELECT @Sent=@Sent-Sent,@Delivered=@Delivered-Delivered,@TotalOpens=@TotalOpens-TotalOpens,@UniqueUserOpens=@UniqueUserOpens-UniqueUserOpens,@UniqueUserMessageClicks=@UniqueUserMessageClicks-UniqueUserMessageClicks,@UniqueUserLinkClicks=@UniqueUserLinkClicks-UniqueUserLinkClicks,@TotalLinkClicks=@TotalLinkClicks-TotalLinkClicks,@Unsubscribes=@Unsubscribes-Unsubscribes,@Bounces=@Bounces-Bounces,@SpamComplaints=@SpamComplaints-SpamComplaints,@Cost=@Cost-Cost    FROM CrmPublisherSummary        WHERE @LastReportDate < @ReportDate        AND SiteID=@SiteID        AND TagPKID=@PKIDUPDATE CrmPublisherSummary SET    Sent=@Sent,    Delivered=@Delivered,    TotalOpens=@TotalOpens,    UniqueUserOpens=@UniqueUserOpens,    UniqueUserMessageClicks=@UniqueUserMessageClicks,    UniqueUserLinkClicks=@UniqueUserLinkClicks,    TotalLinkClicks=@TotalLinkClicks,     Unsubscribes=@Unsubscribes,    Bounces=@Bounces,    SpamComplaints=@SpamComplaints,    Cost=@Cost,    TagID=@TagID    WHERE ReportDate=@ReportDate        AND SiteID=@SiteID        AND TagPKID=@PKIDENDELSE        INSERT INTO CrmPublisherSummary(    ReportDate, SiteID, TagPKID, Sent, Delivered, TotalOpens, UniqueUserOpens,     UniqueUserMessageClicks, UniqueUserLinkClicks, TotalLinkClicks, Unsubscribes,     Bounces, SpamComplaints, Cost, DataFeedID, TagID)         VALUES(    @ReportDate, @SiteID, @PKID, @Sent, @Delivered, @TotalOpens, @UniqueUserOpens,     @UniqueUserMessageClicks, @UniqueUserLinkClicks, @TotalLinkClicks, @Unsubscribes,     @Bounces, @SpamComplaints, @Cost, @DataFeedID, @TagID)SET NOCOUNT OFF this is the one to clear: SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER proc [dbo].[spCRMPublisherSummaryClear](     @SiteID INT,     @DataFeedID INT,     @ReportDate SMALLDATETIME) AS    DELETE LandingSiteSummary        WHERE SiteID=@SiteID AND ReportDate=@ReportDatebut it doesnt seem to be working.Please suggest. 

View 2 Replies View Related

Best Way To Store Simple Up Or Down Values

Jul 20, 2005

I'm creating a table for maintenance records.In each record, many of the values are simply checkboxes (on the UI).In the database table for these attributes, is a good way to store thestate of these checkboxes as simple as 0 for false, 1 for true?-David

View 6 Replies View Related

How To Store Values During Dataflow

Aug 2, 2007

The point is, i want to calculate the max id of a table using Aggregate Transformation, then insert some rows with a OLEDB Command and finally , with another OLEDB Command select those rows with id >(max_id) calculated before.

How can i get a value that was calculated before? Can i store it in a variable?

Many Thanks!

View 5 Replies View Related

Access ComboBox Won't Populate

Dec 13, 2005

I'm using SQLServer2000/Access 2000 .adp. The .adp has a form with 2 combo boxes. The 1st combo box is bound to a stored procedure and loads fine when the form loads. I then set the 2nd combo box's RowSource passing the value of the first into the stored proc:

Me.secondComboBox.RowSource = "EXEC dbo.proc_My2ndProc '" & Me.cboFirstComboBox & "'"
Me.cbosecondComboBox.reQuery

Why won't it work? I've set a form's RecordSource using this methof, and it works great???

Thanks,
Carl

View 1 Replies View Related

ComboBox Bounded Components

Apr 2, 2008

Hi,

I develop a application for mobile devices using C# and Visual Studio 2005 with .NET Compact Framework 2.0. My application is very sample: have a master form where user browse the records in a grid and a detail form for insert and alter the record's.

The application runs fine when the database is empty. I have a problem with combobox bounded components when the sequence above is executed:

1. After append a some of records end the application;
2. Run the application again (the records was in database);
3. Append new record;
4. Cancel the operation;

The first record of the group is changed without user confirmation. The value of each field is changed for the first value of combobox bounded with then.

Why?

The code below cause the problem:


TableBindingSource.AddNew();

DetailEditViewDialog detailEditViewDialog = DetailEditViewDialog.Instance(TableBindingSource));

detailEditViewDialog.Text = "[New]";

detailEditViewDialog.comboBoxCars.SelectedIndex = -1;

detailEditViewDialog.comboBoxPumps.SelectedIndex = -1;

detailEditViewDialog.comboBoxLines.SelectedIndex = -1;

detailEditViewDialog.ShowDialog();


Somebody can help me?

View 1 Replies View Related

T-SQL (SS2K8) :: Display Values Up To 1 Decimal Without Function?

Sep 11, 2014

I am having values as below:

99.87
99.96
8.67

And my output should be as:

99.8
99.9
8.6

How can I do this

View 9 Replies View Related

Display Custom Values In Select Statement

May 8, 2008

Hi,
I have a table called emp, having 2 field name & sex

values are:
name sex
a 1
b 2
c 1

now i want to display the values in above table as like below...
name sex
a Male
b Female
c Male


How to do that...?

View 11 Replies View Related

NUL L Date Values In Report Builder Display As...

Apr 13, 2007

Null date values within a table in SQL Server are displays as (12/30/1899) by Report Builder. Does anyone know how to display the null value as blank?

Thanks in advance

View 1 Replies View Related

Display Null Values As 0 On Line Chart

May 16, 2008

I have a report I'm writing and have got a problem that has stumped me.



The data the report is based in is in this format:



Date Type

1/1/08 A

1/3/08 B

3/1/08 C

3/5/08 B

3/10/08 A

3/12/08 C

3/20/08 A





Management wants a report showing a line chart that summarizes the data by Month and by Type. So, there are 2 series depending on the Type and data values are based on the count of each Type. So, in the example above the x-axis group would be month, the values would be count(Type) and there would be 2 series €“ Series 1. A, B and Series 2. C



I€™ve defined the x-axis to be Month(Fields!DateOccured.Value). However, they want the x-axis to show every month for the entire year not just what is in the database. So, I defined the x-axis to have a scale of 1 to 12 and the major interval is set to 1. This displays 1 through 12 on the x-axis.



The problem is when there is no data (null) for a particular month. Instead of showing 0, the line chart does not plot anything and the line is drawn to the next displayed point. So, for example on the data above the line chart would plot:

January

Series 1 €“ Qty. 2 Series 2 €“ Qty. 0

February

Null

March

Series 1 €“ Qty. 3 Series 2 €“ Qty. 2



The line chart would draw a line from January to March skipping February. I need to display the null values as 0 and not null indicating no occurrences for the month rather than no data present.



Thanks!


View 11 Replies View Related

Display Flag For OrderType Cycle Values

Aug 9, 2015

I have a table with EquipmentNumber, OrderType, BreakdownIndicator and RowID columns and below are the values for one equipmentnumber,

EuipmentNumber OrderType BreakdownIndicator RowId Flag
145812 PM04 1 Yes
145812 PM07 2 Yes
145812 PM07 3 Yes
145812 PM04 4 Yes
145812 PM07 5
145812 PM07 X 6
  145812 PM07 7
  145812 PM04 8 Yes
145812 PM04 9 Yes
145812 PM04 10 Yes

I need to display the 'Flag' column in the result set as mentioned above to identify the cycle values without breakdown indicator values. Here is the logic for this,

1. Need to set the flag 'Yes' for the cycle values PM04 to PM04 in the OrderType and if there is any breakdownindicator value 'X' then we can not consider that cycle for Flag.

View 12 Replies View Related

Optimized Way To Store Hashed Values?

Jul 12, 2007

What is the most optimized way to store Hashed values (obtained by Object.GetHashCode() method) in SQL Server?

Thanks.

View 4 Replies View Related

Option To Store The Inserted Values

Jan 4, 2005

Hi,

In oracle there is "RETURNING" Clause which stores the values inserted to a variable. Is there any option in sql server. i.e storing and fetching takes place at one shot.

eg:
insert into tab (name) values ('hello') returning name into val;

-cheeku

View 4 Replies View Related

Store Multiple Values In A Single Value

Nov 6, 2005

was hoping someone couild provide some insight into a problem I'm trying to solve.

I have a table called SEARCHCRITERIA. It consists of a USERID column and a CRITERIA column. Users will be able to search for other users based on a set of criteria. There are 5 total criteria a user can choose. They can choose as few as none or all five. I'd like to store the criteria chosen as a single number in the SEARCHCRITERIA table. Then use a function to parse out the criteria. For example:

CRITERIAID CRITERIA CRITERIAVALUE
1 AGE 2
2 SEX 4
3 GRADE 8
4 LOCALE 16
5 REGION 32

A user performs a search based on AGE, SEX, and LOCALE. I would then store the value 22 (the sum of 2, 4, and 16) in the SEARCH table. I would then need a function to pull out the three individual values.

Has anyone done anything like this before?

If so, any help would be appreciated!

Thanks in advance!

View 1 Replies View Related

Can Store A List Of Values In A Variable?

Apr 16, 2014

I'm looking for a way to store a list of values in a variable. The query user will need to input a list of file numbers, and my query will need to perform a couple operations on that same list of values, which is why it seems a variable would be most appropriate.

I can't obtain the list of values from the database as they will have to be entered by the user. I'm imagining storing these in a table variable.... User just copies/pastes the list of values somewhere into the query code and executes as usual.

View 7 Replies View Related

Registry To Store Configuration Values ?

Jan 3, 2006

I try to store a SSIS-configuration value in the registry.

But it's failed. I get a warning, that the registry-key is not found.

What is the syntax ? I have searched in BO,MSDN and  Google/Internet ==> nothing.

There is no example.

 

 

View 23 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved