473,788 Members | 2,837 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DDL values with DataReader and stored procedures

For the code below, how could I add an item in the drop
down lists for both company and location to be an "All"
selection that would send to the stored proc.
spRptAttachment s a value of "%" so that it would bring
back all attachments at all companies or all locations at
a company? Thank you, Rob.

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Dim cmd As System.Data.Sql Client.SqlComma nd
cmd = New System.Data.Sql Client.SqlComma nd
("Web_CompanyLi st", Me.SqlConnectio n1)
cmd.CommandType = CommandType.Sto redProcedure
Me.SqlConnectio n1.Open()
Dim myDataReader As
System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
(CommandBehavio r.CloseConnecti on)
ddlCompany.Data Source = myDataReader
ddlCompany.Data ValueField = "CompanyID"
ddlCompany.Data TextField = "CompanyNam e"
ddlCompany.Data Bind()
ddlCompany_Sele ctedIndexChange d(Nothing,
Nothing)
End If
End Sub

Private Sub ddlCompany_Sele ctedIndexChange d(ByVal
sender As System.Object, ByVal e As System.EventArg s)
Handles ddlCompany.Sele ctedIndexChange d
Dim param As System.Data.Sql Client.SqlParam eter
Dim cmd As System.Data.Sql Client.SqlComma nd
Dim intCompanyID As Integer
cmd = New System.Data.Sql Client.SqlComma nd
("WEB_GetLocati onFromCompanyID ", Me.SqlConnectio n1)
cmd.CommandType = CommandType.Sto redProcedure
param = cmd.Parameters. Add(New
System.Data.Sql Client.SqlParam eter("@CompanyI D",
SqlDbType.Int))
param.Direction = ParameterDirect ion.Input
' ********Selecte d Value of Option List*******
param.Value = ddlCompany.Item s
(ddlCompany.Sel ectedIndex).Val ue
Me.SqlConnectio n1.Open()
Dim myDataReader As
System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
(CommandBehavio r.CloseConnecti on)
ddlLocation.Dat aSource = myDataReader
ddlLocation.Dat aValueField = "CompanyLocatio nID"
ddlLocation.Dat aTextField = "CoLo"
ddlLocation.Dat aBind()
End Sub

Private Sub btnSearch_Click (ByVal sender As
System.Object, ByVal e As System.EventArg s) Handles
btnSearch.Click
Dim prmDateFrom As
System.Data.Sql Client.SqlParam eter
Dim prmCoID As System.Data.Sql Client.SqlParam eter
Dim prmColo As System.Data.Sql Client.SqlParam eter
Dim cmd As System.Data.Sql Client.SqlComma nd
Dim intCompanyID As Integer
cmd = New System.Data.Sql Client.SqlComma nd
("spRptAttachme nts", Me.SqlConnectio n1)
cmd.CommandType = CommandType.Sto redProcedure
prmDateFrom = cmd.Parameters. Add(New
System.Data.Sql Client.SqlParam eter("@DateFrom ",
SqlDbType.DateT ime))
prmCoID = cmd.Parameters. Add(New
System.Data.Sql Client.SqlParam eter("@CompanyI D",
SqlDbType.Int))
prmColo = cmd.Parameters. Add(New
System.Data.Sql Client.SqlParam eter("@CompanyL ocationID",
SqlDbType.Int))
prmDateFrom.Dir ection = ParameterDirect ion.Input
prmCoID.Directi on = ParameterDirect ion.Input
prmColo.Directi on = ParameterDirect ion.Input
' ********Selecte d Value of Option List*******
prmDateFrom.Val ue = tbDateFrom.Text
prmCoID.Value = ddlCompany.Item s
(ddlCompany.Sel ectedIndex).Val ue
prmColo.Value = ddlLocation.Ite ms
(ddlLocation.Se lectedIndex).Va lue
Me.SqlConnectio n1.Open()
Dim myDataReader As
System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
(CommandBehavio r.CloseConnecti on)
DataGrid1.DataS ource = myDataReader
DataGrid1.DataB ind()

End Sub

Nov 17 '05 #1
5 2254
After you bind your dropdownlist and close the datareader just do an
items.insert "Select All" at position 0. Next line would be to set
items(0).value to % or whatever character you want.

(Note sometimes I do "Choose One" as my position 0 with a value of empty
string "" so I can use a required field validator. Same concept)

Hope this helps.

"Rob Wire" <ST*@hotmail.co m> wrote in message
news:8e******** *************** *****@phx.gbl.. .
For the code below, how could I add an item in the drop
down lists for both company and location to be an "All"
selection that would send to the stored proc.
spRptAttachment s a value of "%" so that it would bring
back all attachments at all companies or all locations at
a company? Thank you, Rob.

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Dim cmd As System.Data.Sql Client.SqlComma nd
cmd = New System.Data.Sql Client.SqlComma nd
("Web_CompanyLi st", Me.SqlConnectio n1)
cmd.CommandType = CommandType.Sto redProcedure
Me.SqlConnectio n1.Open()
Dim myDataReader As
System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
(CommandBehavio r.CloseConnecti on)
ddlCompany.Data Source = myDataReader
ddlCompany.Data ValueField = "CompanyID"
ddlCompany.Data TextField = "CompanyNam e"
ddlCompany.Data Bind()
ddlCompany_Sele ctedIndexChange d(Nothing,
Nothing)
End If
End Sub

Private Sub ddlCompany_Sele ctedIndexChange d(ByVal
sender As System.Object, ByVal e As System.EventArg s)
Handles ddlCompany.Sele ctedIndexChange d
Dim param As System.Data.Sql Client.SqlParam eter
Dim cmd As System.Data.Sql Client.SqlComma nd
Dim intCompanyID As Integer
cmd = New System.Data.Sql Client.SqlComma nd
("WEB_GetLocati onFromCompanyID ", Me.SqlConnectio n1)
cmd.CommandType = CommandType.Sto redProcedure
param = cmd.Parameters. Add(New
System.Data.Sql Client.SqlParam eter("@CompanyI D",
SqlDbType.Int))
param.Direction = ParameterDirect ion.Input
' ********Selecte d Value of Option List*******
param.Value = ddlCompany.Item s
(ddlCompany.Sel ectedIndex).Val ue
Me.SqlConnectio n1.Open()
Dim myDataReader As
System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
(CommandBehavio r.CloseConnecti on)
ddlLocation.Dat aSource = myDataReader
ddlLocation.Dat aValueField = "CompanyLocatio nID"
ddlLocation.Dat aTextField = "CoLo"
ddlLocation.Dat aBind()
End Sub

Private Sub btnSearch_Click (ByVal sender As
System.Object, ByVal e As System.EventArg s) Handles
btnSearch.Click
Dim prmDateFrom As
System.Data.Sql Client.SqlParam eter
Dim prmCoID As System.Data.Sql Client.SqlParam eter
Dim prmColo As System.Data.Sql Client.SqlParam eter
Dim cmd As System.Data.Sql Client.SqlComma nd
Dim intCompanyID As Integer
cmd = New System.Data.Sql Client.SqlComma nd
("spRptAttachme nts", Me.SqlConnectio n1)
cmd.CommandType = CommandType.Sto redProcedure
prmDateFrom = cmd.Parameters. Add(New
System.Data.Sql Client.SqlParam eter("@DateFrom ",
SqlDbType.DateT ime))
prmCoID = cmd.Parameters. Add(New
System.Data.Sql Client.SqlParam eter("@CompanyI D",
SqlDbType.Int))
prmColo = cmd.Parameters. Add(New
System.Data.Sql Client.SqlParam eter("@CompanyL ocationID",
SqlDbType.Int))
prmDateFrom.Dir ection = ParameterDirect ion.Input
prmCoID.Directi on = ParameterDirect ion.Input
prmColo.Directi on = ParameterDirect ion.Input
' ********Selecte d Value of Option List*******
prmDateFrom.Val ue = tbDateFrom.Text
prmCoID.Value = ddlCompany.Item s
(ddlCompany.Sel ectedIndex).Val ue
prmColo.Value = ddlLocation.Ite ms
(ddlLocation.Se lectedIndex).Va lue
Me.SqlConnectio n1.Open()
Dim myDataReader As
System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
(CommandBehavio r.CloseConnecti on)
DataGrid1.DataS ource = myDataReader
DataGrid1.DataB ind()

End Sub

Nov 17 '05 #2
Hello Rob,

I have read the code that you paste. It seems that you populate companyID and name in ddlCompany drop down list. Then
populate ddlLocation drop down list according to the selected value in ddlCompany.

In the search button onclick handler, you ran a SP according to values from drop down list.

However, I am quite clear on your questions? Could you please explain more on what you want to implement, what the
problem is so that we could provide more information to you?

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Rob Wire" <st*@hotmail.co m>
!Sender: "Rob Wire" <st*@hotmail.co m>
!References: <8e************ *************** *@phx.gbl> <#e************ **@tk2msftngp13 .phx.gbl>
!Subject: Re: DDL values with DataReader and stored procedures
!Date: Wed, 6 Aug 2003 12:29:31 -0700
!Lines: 122
!Message-ID: <07************ *************** *@phx.gbl>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!Thread-Index: AcNcUQ8g52Xt2Lx CT8+b0l82kNicsQ ==
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
!Path: cpmsftngxa06.ph x.gbl
!Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1654 89
!NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
!X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
!
!How could I apply the below to a wildcard int primary key
!id field? i.e. to avoid getting:
!
!Syntax error converting the varchar value '%' to a column
!of data type int
!
!>-----Original Message-----
!>After you bind your dropdownlist and close the datareader
!just do an
!>items.insert "Select All" at position 0. Next line would
!be to set
!>items(0).valu e to % or whatever character you want.
!>
!>(Note sometimes I do "Choose One" as my position 0 with a
!value of empty
!>string "" so I can use a required field validator. Same
!concept)
!>
!>Hope this helps.
!>
!>"Rob Wire" <ST*@hotmail.co m> wrote in message
!>news:8e****** *************** *******@phx.gbl ...
!>> For the code below, how could I add an item in the drop
!>> down lists for both company and location to be an "All"
!>> selection that would send to the stored proc.
!>> spRptAttachment s a value of "%" so that it would bring
!>> back all attachments at all companies or all locations
!at
!>> a company? Thank you, Rob.
!>>
!>> Private Sub Page_Load(ByVal sender As System.Object,
!>> ByVal e As System.EventArg s) Handles MyBase.Load
!>> If Not IsPostBack Then
!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>> cmd = New System.Data.Sql Client.SqlComma nd
!>> ("Web_CompanyLi st", Me.SqlConnectio n1)
!>> cmd.CommandType =
!CommandType.St oredProcedure
!>> Me.SqlConnectio n1.Open()
!>> Dim myDataReader As
!>> System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
!>> (CommandBehavio r.CloseConnecti on)
!>> ddlCompany.Data Source = myDataReader
!>> ddlCompany.Data ValueField = "CompanyID"
!>> ddlCompany.Data TextField = "CompanyNam e"
!>> ddlCompany.Data Bind()
!>> ddlCompany_Sele ctedIndexChange d(Nothing,
!>> Nothing)
!>> End If
!>> End Sub
!>>
!>> Private Sub ddlCompany_Sele ctedIndexChange d(ByVal
!>> sender As System.Object, ByVal e As System.EventArg s)
!>> Handles ddlCompany.Sele ctedIndexChange d
!>> Dim param As System.Data.Sql Client.SqlParam eter
!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>> Dim intCompanyID As Integer
!>> cmd = New System.Data.Sql Client.SqlComma nd
!>> ("WEB_GetLocati onFromCompanyID ", Me.SqlConnectio n1)
!>> cmd.CommandType = CommandType.Sto redProcedure
!>> param = cmd.Parameters. Add(New
!>> System.Data.Sql Client.SqlParam eter("@CompanyI D",
!>> SqlDbType.Int))
!>> param.Direction = ParameterDirect ion.Input
!>> ' ********Selecte d Value of Option List*******
!>> param.Value = ddlCompany.Item s
!>> (ddlCompany.Sel ectedIndex).Val ue
!>> Me.SqlConnectio n1.Open()
!>> Dim myDataReader As
!>> System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
!>> (CommandBehavio r.CloseConnecti on)
!>> ddlLocation.Dat aSource = myDataReader
!>> ddlLocation.Dat aValueField = "CompanyLocatio nID"
!>> ddlLocation.Dat aTextField = "CoLo"
!>> ddlLocation.Dat aBind()
!>> End Sub
!>>
!>> Private Sub btnSearch_Click (ByVal sender As
!>> System.Object, ByVal e As System.EventArg s) Handles
!>> btnSearch.Click
!>> Dim prmDateFrom As
!>> System.Data.Sql Client.SqlParam eter
!>> Dim prmCoID As
!System.Data.Sq lClient.SqlPara meter
!>> Dim prmColo As
!System.Data.Sq lClient.SqlPara meter
!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>> Dim intCompanyID As Integer
!>> cmd = New System.Data.Sql Client.SqlComma nd
!>> ("spRptAttachme nts", Me.SqlConnectio n1)
!>> cmd.CommandType = CommandType.Sto redProcedure
!>> prmDateFrom = cmd.Parameters. Add(New
!>> System.Data.Sql Client.SqlParam eter("@DateFrom ",
!>> SqlDbType.DateT ime))
!>> prmCoID = cmd.Parameters. Add(New
!>> System.Data.Sql Client.SqlParam eter("@CompanyI D",
!>> SqlDbType.Int))
!>> prmColo = cmd.Parameters. Add(New
!>> System.Data.Sql Client.SqlParam eter("@CompanyL ocationID",
!>> SqlDbType.Int))
!>> prmDateFrom.Dir ection = ParameterDirect ion.Input
!>> prmCoID.Directi on = ParameterDirect ion.Input
!>> prmColo.Directi on = ParameterDirect ion.Input
!>> ' ********Selecte d Value of Option List*******
!>> prmDateFrom.Val ue = tbDateFrom.Text
!>> prmCoID.Value = ddlCompany.Item s
!>> (ddlCompany.Sel ectedIndex).Val ue
!>> prmColo.Value = ddlLocation.Ite ms
!>> (ddlLocation.Se lectedIndex).Va lue
!>> Me.SqlConnectio n1.Open()
!>> Dim myDataReader As
!>> System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er
!>> (CommandBehavio r.CloseConnecti on)
!>> DataGrid1.DataS ource = myDataReader
!>> DataGrid1.DataB ind()
!>>
!>> End Sub
!>>
!>
!>
!>.
!>
!
Nov 17 '05 #3
What I would like to do is have the ddl have a fake record
in the list that would send to the stored procedure a wild
card like '%' that would work with the int value of the
primary key field in the table that the drop down is
displaying, hence to return all rows no matter what the id
is if that is selected.
-----Original Message-----
Hello Rob,

I have read the code that you paste. It seems that you populate companyID and name in ddlCompany drop down list.
Thenpopulate ddlLocation drop down list according to the selected value in ddlCompany.
In the search button onclick handler, you ran a SP according to values from drop down list.
However, I am quite clear on your questions? Could you please explain more on what you want to implement, what
theproblem is so that we could provide more information to you?
Thanks very much.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!Content-Class: urn:content-classes:message
!From: "Rob Wire" <st*@hotmail.co m>
!Sender: "Rob Wire" <st*@hotmail.co m>
!References: <8e************ *************** *@phx.gbl> <#e************ **@tk2msftngp13 .phx.gbl>!Subject: Re: DDL values with DataReader and stored procedures!Date: Wed, 6 Aug 2003 12:29:31 -0700
!Lines: 122
!Message-ID: <07************ *************** *@phx.gbl>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!Thread-Index: AcNcUQ8g52Xt2Lx CT8+b0l82kNicsQ ==
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
!Path: cpmsftngxa06.ph x.gbl
!Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1654 89!NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
!X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
!
!How could I apply the below to a wildcard int primary key!id field? i.e. to avoid getting:
!
!Syntax error converting the varchar value '%' to a column!of data type int
!
!>-----Original Message-----
!>After you bind your dropdownlist and close the datareader!just do an
!>items.inse rt "Select All" at position 0. Next line would!be to set
!>items(0).val ue to % or whatever character you want.
!>
!>(Note sometimes I do "Choose One" as my position 0 with a!value of empty
!>string "" so I can use a required field validator. Same!concept)
!>
!>Hope this helps.
!>
!>"Rob Wire" <ST*@hotmail.co m> wrote in message
!>news:8e***** *************** ********@phx.gb l...
!>> For the code below, how could I add an item in the drop!>> down lists for both company and location to be an "All"!>> selection that would send to the stored proc.
!>> spRptAttachment s a value of "%" so that it would bring
!>> back all attachments at all companies or all locations!at
!>> a company? Thank you, Rob.
!>>
!>> Private Sub Page_Load(ByVal sender As System.Object,!>> ByVal e As System.EventArg s) Handles MyBase.Load
!>> If Not IsPostBack Then
!>> Dim cmd As System.Data.Sql Client.SqlComma nd!>> cmd = New System.Data.Sql Client.SqlComma nd
!>> ("Web_CompanyLi st", Me.SqlConnectio n1)
!>> cmd.CommandType =
!CommandType.S toredProcedure
!>> Me.SqlConnectio n1.Open()
!>> Dim myDataReader As
!>> System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er!>> (CommandBehavio r.CloseConnecti on)
!>> ddlCompany.Data Source = myDataReader
!>> ddlCompany.Data ValueField = "CompanyID"
!>> ddlCompany.Data TextField = "CompanyNam e"
!>> ddlCompany.Data Bind()
!>> ddlCompany_Sele ctedIndexChange d(Nothing,
!>> Nothing)
!>> End If
!>> End Sub
!>>
!>> Private Sub ddlCompany_Sele ctedIndexChange d(ByVal
!>> sender As System.Object, ByVal e As System.EventArg s)
!>> Handles ddlCompany.Sele ctedIndexChange d
!>> Dim param As System.Data.Sql Client.SqlParam eter!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>> Dim intCompanyID As Integer
!>> cmd = New System.Data.Sql Client.SqlComma nd
!>> ("WEB_GetLocati onFromCompanyID ", Me.SqlConnectio n1)
!>> cmd.CommandType = CommandType.Sto redProcedure
!>> param = cmd.Parameters. Add(New
!>> System.Data.Sql Client.SqlParam eter("@CompanyI D",
!>> SqlDbType.Int))
!>> param.Direction = ParameterDirect ion.Input
!>> ' ********Selecte d Value of Option List*******
!>> param.Value = ddlCompany.Item s
!>> (ddlCompany.Sel ectedIndex).Val ue
!>> Me.SqlConnectio n1.Open()
!>> Dim myDataReader As
!>> System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er!>> (CommandBehavio r.CloseConnecti on)
!>> ddlLocation.Dat aSource = myDataReader
!>> ddlLocation.Dat aValueField = "CompanyLocatio nID"!>> ddlLocation.Dat aTextField = "CoLo"
!>> ddlLocation.Dat aBind()
!>> End Sub
!>>
!>> Private Sub btnSearch_Click (ByVal sender As
!>> System.Object, ByVal e As System.EventArg s) Handles
!>> btnSearch.Click
!>> Dim prmDateFrom As
!>> System.Data.Sql Client.SqlParam eter
!>> Dim prmCoID As
!System.Data.S qlClient.SqlPar ameter
!>> Dim prmColo As
!System.Data.S qlClient.SqlPar ameter
!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>> Dim intCompanyID As Integer
!>> cmd = New System.Data.Sql Client.SqlComma nd
!>> ("spRptAttachme nts", Me.SqlConnectio n1)
!>> cmd.CommandType = CommandType.Sto redProcedure
!>> prmDateFrom = cmd.Parameters. Add(New
!>> System.Data.Sql Client.SqlParam eter("@DateFrom ",
!>> SqlDbType.DateT ime))
!>> prmCoID = cmd.Parameters. Add(New
!>> System.Data.Sql Client.SqlParam eter("@CompanyI D",
!>> SqlDbType.Int))
!>> prmColo = cmd.Parameters. Add(New
!>> System.Data.Sql Client.SqlParam eter ("@CompanyLocat ionID",!>> SqlDbType.Int))
!>> prmDateFrom.Dir ection = ParameterDirect ion.Input!>> prmCoID.Directi on = ParameterDirect ion.Input
!>> prmColo.Directi on = ParameterDirect ion.Input
!>> ' ********Selecte d Value of Option List*******
!>> prmDateFrom.Val ue = tbDateFrom.Text
!>> prmCoID.Value = ddlCompany.Item s
!>> (ddlCompany.Sel ectedIndex).Val ue
!>> prmColo.Value = ddlLocation.Ite ms
!>> (ddlLocation.Se lectedIndex).Va lue
!>> Me.SqlConnectio n1.Open()
!>> Dim myDataReader As
!>> System.Data.Sql client.SqlDataR eader = cmd.ExecuteRead er!>> (CommandBehavio r.CloseConnecti on)
!>> DataGrid1.DataS ource = myDataReader
!>> DataGrid1.DataB ind()
!>>
!>> End Sub
!>>
!>
!>
!>.
!>
!
.

Nov 17 '05 #4
Hello Rob,

Sorry for the late response. I am not quite familar with SQL statements. So I am not sure of how to transfer a value like % for a
int value type. What I knew is that we could only use %, * in string type values.

My suggestion is to implement it in stored procedure level. For an example, when stored procedure received one specific
value, it will return all the rows no matter what ID is selected.

Please let me know if you have any concerns on it. Thanks.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Rob Wire" <st*@hotmail.co m>
!Sender: "Rob Wire" <st*@hotmail.co m>
!References: <8e************ *************** *@phx.gbl> <#e************ **@tk2msftngp13 .phx.gbl>
<07************ *************** *@phx.gbl> <mq************ **@cpmsftngxa06 .phx.gbl>
!Subject: Re: DDL values with DataReader and stored procedures
!Date: Fri, 8 Aug 2003 12:39:42 -0700
!Lines: 205
!Message-ID: <01************ *************** *@phx.gbl>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNd5NAmk8VGjaZ QT1K+C0BMkc2Vuw ==
!Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
!Path: cpmsftngxa06.ph x.gbl
!Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1662 57
!NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
!X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
!
!What I would like to do is have the ddl have a fake record
!in the list that would send to the stored procedure a wild
!card like '%' that would work with the int value of the
!primary key field in the table that the drop down is
!displaying, hence to return all rows no matter what the id
!is if that is selected.
!
!>-----Original Message-----
!>Hello Rob,
!>
!>I have read the code that you paste. It seems that you
!populate companyID and name in ddlCompany drop down list.
!Then
!>populate ddlLocation drop down list according to the
!selected value in ddlCompany.
!>
!>In the search button onclick handler, you ran a SP
!according to values from drop down list.
!>
!>However, I am quite clear on your questions? Could you
!please explain more on what you want to implement, what
!the
!>problem is so that we could provide more information to
!you?
!>
!>Thanks very much.
!>
!>Best regards,
!>Yanhong Huang
!>Microsoft Online Partner Support
!>
!>Get Secure! - www.microsoft.com/security
!>This posting is provided "AS IS" with no warranties, and
!confers no rights.
!>
!>--------------------
!>!Content-Class: urn:content-classes:message
!>!From: "Rob Wire" <st*@hotmail.co m>
!>!Sender: "Rob Wire" <st*@hotmail.co m>
!>!References: <8e************ *************** *@phx.gbl>
!<#e*********** ***@tk2msftngp1 3.phx.gbl>
!>!Subject: Re: DDL values with DataReader and stored
!procedures
!>!Date: Wed, 6 Aug 2003 12:29:31 -0700
!>!Lines: 122
!>!Message-ID: <07************ *************** *@phx.gbl>
!>!MIME-Version: 1.0
!>!Content-Type: text/plain;
!>! charset="iso-8859-1"
!>!Content-Transfer-Encoding: 7bit
!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!Thread-Index: AcNcUQ8g52Xt2Lx CT8+b0l82kNicsQ ==
!>!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!>!Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
!>!Path: cpmsftngxa06.ph x.gbl
!>!Xref: cpmsftngxa06.ph x.gbl
!microsoft.publ ic.dotnet.frame work.aspnet:165 489
!>!NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
!>!X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
!>!
!>!How could I apply the below to a wildcard int primary
!key
!>!id field? i.e. to avoid getting:
!>!
!>!Syntax error converting the varchar value '%' to a
!column
!>!of data type int
!>!
!>!>-----Original Message-----
!>!>After you bind your dropdownlist and close the
!datareader
!>!just do an
!>!>items.inser t "Select All" at position 0. Next line
!would
!>!be to set
!>!>items(0).va lue to % or whatever character you want.
!>!>
!>!>(Note sometimes I do "Choose One" as my position 0 with
!a
!>!value of empty
!>!>string "" so I can use a required field validator.
!Same
!>!concept)
!>!>
!>!>Hope this helps.
!>!>
!>!>"Rob Wire" <ST*@hotmail.co m> wrote in message
!>!>news:8e**** *************** *********@phx.g bl...
!>!>> For the code below, how could I add an item in the
!drop
!>!>> down lists for both company and location to be
!an "All"
!>!>> selection that would send to the stored proc.
!>!>> spRptAttachment s a value of "%" so that it would bring
!>!>> back all attachments at all companies or all
!locations
!>!at
!>!>> a company? Thank you, Rob.
!>!>>
!>!>> Private Sub Page_Load(ByVal sender As
!System.Object,
!>!>> ByVal e As System.EventArg s) Handles MyBase.Load
!>!>> If Not IsPostBack Then
!>!>> Dim cmd As
!System.Data.Sq lClient.SqlComm and
!>!>> cmd = New System.Data.Sql Client.SqlComma nd
!>!>> ("Web_CompanyLi st", Me.SqlConnectio n1)
!>!>> cmd.CommandType =
!>!CommandType. StoredProcedure
!>!>> Me.SqlConnectio n1.Open()
!>!>> Dim myDataReader As
!>!>> System.Data.Sql client.SqlDataR eader =
!cmd.ExecuteRea der
!>!>> (CommandBehavio r.CloseConnecti on)
!>!>> ddlCompany.Data Source = myDataReader
!>!>> ddlCompany.Data ValueField = "CompanyID"
!>!>> ddlCompany.Data TextField = "CompanyNam e"
!>!>> ddlCompany.Data Bind()
!>!>> ddlCompany_Sele ctedIndexChange d(Nothing,
!>!>> Nothing)
!>!>> End If
!>!>> End Sub
!>!>>
!>!>> Private Sub ddlCompany_Sele ctedIndexChange d(ByVal
!>!>> sender As System.Object, ByVal e As System.EventArg s)
!>!>> Handles ddlCompany.Sele ctedIndexChange d
!>!>> Dim param As
!System.Data.Sq lClient.SqlPara meter
!>!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>!>> Dim intCompanyID As Integer
!>!>> cmd = New System.Data.Sql Client.SqlComma nd
!>!>> ("WEB_GetLocati onFromCompanyID ", Me.SqlConnectio n1)
!>!>> cmd.CommandType = CommandType.Sto redProcedure
!>!>> param = cmd.Parameters. Add(New
!>!>> System.Data.Sql Client.SqlParam eter("@CompanyI D",
!>!>> SqlDbType.Int))
!>!>> param.Direction = ParameterDirect ion.Input
!>!>> ' ********Selecte d Value of Option List*******
!>!>> param.Value = ddlCompany.Item s
!>!>> (ddlCompany.Sel ectedIndex).Val ue
!>!>> Me.SqlConnectio n1.Open()
!>!>> Dim myDataReader As
!>!>> System.Data.Sql client.SqlDataR eader =
!cmd.ExecuteRea der
!>!>> (CommandBehavio r.CloseConnecti on)
!>!>> ddlLocation.Dat aSource = myDataReader
!>!>> ddlLocation.Dat aValueField
!= "CompanyLocatio nID"
!>!>> ddlLocation.Dat aTextField = "CoLo"
!>!>> ddlLocation.Dat aBind()
!>!>> End Sub
!>!>>
!>!>> Private Sub btnSearch_Click (ByVal sender As
!>!>> System.Object, ByVal e As System.EventArg s) Handles
!>!>> btnSearch.Click
!>!>> Dim prmDateFrom As
!>!>> System.Data.Sql Client.SqlParam eter
!>!>> Dim prmCoID As
!>!System.Data. SqlClient.SqlPa rameter
!>!>> Dim prmColo As
!>!System.Data. SqlClient.SqlPa rameter
!>!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>!>> Dim intCompanyID As Integer
!>!>> cmd = New System.Data.Sql Client.SqlComma nd
!>!>> ("spRptAttachme nts", Me.SqlConnectio n1)
!>!>> cmd.CommandType = CommandType.Sto redProcedure
!>!>> prmDateFrom = cmd.Parameters. Add(New
!>!>> System.Data.Sql Client.SqlParam eter("@DateFrom ",
!>!>> SqlDbType.DateT ime))
!>!>> prmCoID = cmd.Parameters. Add(New
!>!>> System.Data.Sql Client.SqlParam eter("@CompanyI D",
!>!>> SqlDbType.Int))
!>!>> prmColo = cmd.Parameters. Add(New
!>!>> System.Data.Sql Client.SqlParam eter
!("@CompanyLoca tionID",
!>!>> SqlDbType.Int))
!>!>> prmDateFrom.Dir ection =
!ParameterDirec tion.Input
!>!>> prmCoID.Directi on = ParameterDirect ion.Input
!>!>> prmColo.Directi on = ParameterDirect ion.Input
!>!>> ' ********Selecte d Value of Option List*******
!>!>> prmDateFrom.Val ue = tbDateFrom.Text
!>!>> prmCoID.Value = ddlCompany.Item s
!>!>> (ddlCompany.Sel ectedIndex).Val ue
!>!>> prmColo.Value = ddlLocation.Ite ms
!>!>> (ddlLocation.Se lectedIndex).Va lue
!>!>> Me.SqlConnectio n1.Open()
!>!>> Dim myDataReader As
!>!>> System.Data.Sql client.SqlDataR eader =
!cmd.ExecuteRea der
!>!>> (CommandBehavio r.CloseConnecti on)
!>!>> DataGrid1.DataS ource = myDataReader
!>!>> DataGrid1.DataB ind()
!>!>>
!>!>> End Sub
!>!>>
!>!>
!>!>
!>!>.
!>!>
!>!
!>
!>
!>.
!>
!
Nov 17 '05 #5
Hello Rob,

Do you still have any question on the issue? Please post here if you have
follow up questions.

For SQL server stored procedures, please refer to SQL books online to get
code samples. I think the logic should be:

USE pubs
GO
CREATE PROCEDURE au_info
@ID int,
AS
IF (ID == ***)
THEN
SELECT * from ...
ELSE
SELECT au_lname, au_fname, title, pub_name
FROM authors a INNER JOIN titleauthor ta
ON a.au_id = ta.au_id INNER JOIN titles t
ON t.title_id = ta.title_id INNER JOIN publishers p
ON t.pub_id = p.pub_id
WHERE au_fname = @ID
GO

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Rob Wire" <st*@hotmail.co m>
!Sender: "Rob Wire" <st*@hotmail.co m>
!References: <8e************ *************** *@phx.gbl>
<#e************ **@tk2msftngp13 .phx.gbl>
<07************ *************** *@phx.gbl>
<mq************ **@cpmsftngxa06 .phx.gbl>
!Subject: Re: DDL values with DataReader and stored procedures
!Date: Fri, 8 Aug 2003 12:39:42 -0700
!Lines: 205
!Message-ID: <01************ *************** *@phx.gbl>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNd5NAmk8VGjaZ QT1K+C0BMkc2Vuw ==
!Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
!Path: cpmsftngxa06.ph x.gbl
!Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1662 57
!NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
!X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
!
!What I would like to do is have the ddl have a fake record
!in the list that would send to the stored procedure a wild
!card like '%' that would work with the int value of the
!primary key field in the table that the drop down is
!displaying, hence to return all rows no matter what the id
!is if that is selected.
!
!>-----Original Message-----
!>Hello Rob,
!>
!>I have read the code that you paste. It seems that you
!populate companyID and name in ddlCompany drop down list.
!Then
!>populate ddlLocation drop down list according to the
!selected value in ddlCompany.
!>
!>In the search button onclick handler, you ran a SP
!according to values from drop down list.
!>
!>However, I am quite clear on your questions? Could you
!please explain more on what you want to implement, what
!the
!>problem is so that we could provide more information to
!you?
!>
!>Thanks very much.
!>
!>Best regards,
!>Yanhong Huang
!>Microsoft Online Partner Support
!>
!>Get Secure! - www.microsoft.com/security
!>This posting is provided "AS IS" with no warranties, and
!confers no rights.
!>
!>--------------------
!>!Content-Class: urn:content-classes:message
!>!From: "Rob Wire" <st*@hotmail.co m>
!>!Sender: "Rob Wire" <st*@hotmail.co m>
!>!References: <8e************ *************** *@phx.gbl>
!<#e*********** ***@tk2msftngp1 3.phx.gbl>
!>!Subject: Re: DDL values with DataReader and stored
!procedures
!>!Date: Wed, 6 Aug 2003 12:29:31 -0700
!>!Lines: 122
!>!Message-ID: <07************ *************** *@phx.gbl>
!>!MIME-Version: 1.0
!>!Content-Type: text/plain;
!>! charset="iso-8859-1"
!>!Content-Transfer-Encoding: 7bit
!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!Thread-Index: AcNcUQ8g52Xt2Lx CT8+b0l82kNicsQ ==
!>!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!>!Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
!>!Path: cpmsftngxa06.ph x.gbl
!>!Xref: cpmsftngxa06.ph x.gbl
!microsoft.publ ic.dotnet.frame work.aspnet:165 489
!>!NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
!>!X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
!>!
!>!How could I apply the below to a wildcard int primary
!key
!>!id field? i.e. to avoid getting:
!>!
!>!Syntax error converting the varchar value '%' to a
!column
!>!of data type int
!>!
!>!>-----Original Message-----
!>!>After you bind your dropdownlist and close the
!datareader
!>!just do an
!>!>items.inser t "Select All" at position 0. Next line
!would
!>!be to set
!>!>items(0).va lue to % or whatever character you want.
!>!>
!>!>(Note sometimes I do "Choose One" as my position 0 with
!a
!>!value of empty
!>!>string "" so I can use a required field validator.
!Same
!>!concept)
!>!>
!>!>Hope this helps.
!>!>
!>!>"Rob Wire" <ST*@hotmail.co m> wrote in message
!>!>news:8e**** *************** *********@phx.g bl...
!>!>> For the code below, how could I add an item in the
!drop
!>!>> down lists for both company and location to be
!an "All"
!>!>> selection that would send to the stored proc.
!>!>> spRptAttachment s a value of "%" so that it would bring
!>!>> back all attachments at all companies or all
!locations
!>!at
!>!>> a company? Thank you, Rob.
!>!>>
!>!>> Private Sub Page_Load(ByVal sender As
!System.Object,
!>!>> ByVal e As System.EventArg s) Handles MyBase.Load
!>!>> If Not IsPostBack Then
!>!>> Dim cmd As
!System.Data.Sq lClient.SqlComm and
!>!>> cmd = New System.Data.Sql Client.SqlComma nd
!>!>> ("Web_CompanyLi st", Me.SqlConnectio n1)
!>!>> cmd.CommandType =
!>!CommandType. StoredProcedure
!>!>> Me.SqlConnectio n1.Open()
!>!>> Dim myDataReader As
!>!>> System.Data.Sql client.SqlDataR eader =
!cmd.ExecuteRea der
!>!>> (CommandBehavio r.CloseConnecti on)
!>!>> ddlCompany.Data Source = myDataReader
!>!>> ddlCompany.Data ValueField = "CompanyID"
!>!>> ddlCompany.Data TextField = "CompanyNam e"
!>!>> ddlCompany.Data Bind()
!>!>> ddlCompany_Sele ctedIndexChange d(Nothing,
!>!>> Nothing)
!>!>> End If
!>!>> End Sub
!>!>>
!>!>> Private Sub ddlCompany_Sele ctedIndexChange d(ByVal
!>!>> sender As System.Object, ByVal e As System.EventArg s)
!>!>> Handles ddlCompany.Sele ctedIndexChange d
!>!>> Dim param As
!System.Data.Sq lClient.SqlPara meter
!>!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>!>> Dim intCompanyID As Integer
!>!>> cmd = New System.Data.Sql Client.SqlComma nd
!>!>> ("WEB_GetLocati onFromCompanyID ", Me.SqlConnectio n1)
!>!>> cmd.CommandType = CommandType.Sto redProcedure
!>!>> param = cmd.Parameters. Add(New
!>!>> System.Data.Sql Client.SqlParam eter("@CompanyI D",
!>!>> SqlDbType.Int))
!>!>> param.Direction = ParameterDirect ion.Input
!>!>> ' ********Selecte d Value of Option List*******
!>!>> param.Value = ddlCompany.Item s
!>!>> (ddlCompany.Sel ectedIndex).Val ue
!>!>> Me.SqlConnectio n1.Open()
!>!>> Dim myDataReader As
!>!>> System.Data.Sql client.SqlDataR eader =
!cmd.ExecuteRea der
!>!>> (CommandBehavio r.CloseConnecti on)
!>!>> ddlLocation.Dat aSource = myDataReader
!>!>> ddlLocation.Dat aValueField
!= "CompanyLocatio nID"
!>!>> ddlLocation.Dat aTextField = "CoLo"
!>!>> ddlLocation.Dat aBind()
!>!>> End Sub
!>!>>
!>!>> Private Sub btnSearch_Click (ByVal sender As
!>!>> System.Object, ByVal e As System.EventArg s) Handles
!>!>> btnSearch.Click
!>!>> Dim prmDateFrom As
!>!>> System.Data.Sql Client.SqlParam eter
!>!>> Dim prmCoID As
!>!System.Data. SqlClient.SqlPa rameter
!>!>> Dim prmColo As
!>!System.Data. SqlClient.SqlPa rameter
!>!>> Dim cmd As System.Data.Sql Client.SqlComma nd
!>!>> Dim intCompanyID As Integer
!>!>> cmd = New System.Data.Sql Client.SqlComma nd
!>!>> ("spRptAttachme nts", Me.SqlConnectio n1)
!>!>> cmd.CommandType = CommandType.Sto redProcedure
!>!>> prmDateFrom = cmd.Parameters. Add(New
!>!>> System.Data.Sql Client.SqlParam eter("@DateFrom ",
!>!>> SqlDbType.DateT ime))
!>!>> prmCoID = cmd.Parameters. Add(New
!>!>> System.Data.Sql Client.SqlParam eter("@CompanyI D",
!>!>> SqlDbType.Int))
!>!>> prmColo = cmd.Parameters. Add(New
!>!>> System.Data.Sql Client.SqlParam eter
!("@CompanyLoca tionID",
!>!>> SqlDbType.Int))
!>!>> prmDateFrom.Dir ection =
!ParameterDirec tion.Input
!>!>> prmCoID.Directi on = ParameterDirect ion.Input
!>!>> prmColo.Directi on = ParameterDirect ion.Input
!>!>> ' ********Selecte d Value of Option List*******
!>!>> prmDateFrom.Val ue = tbDateFrom.Text
!>!>> prmCoID.Value = ddlCompany.Item s
!>!>> (ddlCompany.Sel ectedIndex).Val ue
!>!>> prmColo.Value = ddlLocation.Ite ms
!>!>> (ddlLocation.Se lectedIndex).Va lue
!>!>> Me.SqlConnectio n1.Open()
!>!>> Dim myDataReader As
!>!>> System.Data.Sql client.SqlDataR eader =
!cmd.ExecuteRea der
!>!>> (CommandBehavio r.CloseConnecti on)
!>!>> DataGrid1.DataS ource = myDataReader
!>!>> DataGrid1.DataB ind()
!>!>>
!>!>> End Sub
!>!>>
!>!>
!>!>
!>!>.
!>!>
!>!
!>
!>
!>.
!>
!

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6103
by: Mike | last post by:
Hello, I'm currently working on debugging a very large DTS package that was created by someone else for the purpose of importing data into my company's database. The data is mainly user/contact-related data for our customer base. We ran into problems when one import, of about 40,000 rows, took upwards of six hours to complete. Many of the stored procedures used by this package were written using XML. I've re-written many of them
5
3486
by: Tim Marshall | last post by:
I was following the thread "Re: Access Treeview - Is it Safe Yet?" with interest and on reading the post describing Lauren Quantrell's SmartTree, I've run into something I don't understand: Stored Procedures. I thought stored pricedures were an Oracle/MS SQL Server thing and don't know how they work with Access Jet. I've looked at some of the help on stored procedures in A2003, but really don't understand what's going on. Can someone...
1
8937
by: Patrick.O.Ige | last post by:
I have been paging with DataSet using "DataGridPageChangedEventArgs" and i guess it works with only Dataset because default paging requires that the DataGrid be able to determine the number of total records in the DataSource.This is possible with the DataSet, but not with the SqlDataReader.. So what are the best ways to apply paging to SqlDataReader.... For example how can i apply paging with the code below:- THANKS AND ALL IDEAS...
2
3401
by: orencs | last post by:
Hi, I am using Datareader and stored procedure in C# ADO.NET. When I am running the stored procedure in the SQL Query Analyzer and recieve two rows (as I hace expected) col1 col2 0 1 0 2 4 2
7
1694
by: simon | last post by:
What is the best way to read the values from the datatbase. I have sql="SELECT userName, userCountry, userVisit from users where userID=2" Create a command object? Dim oCmd As SqlCommand oCmd = New SqlCommand(sql, Connection) object = oCmd.ExecuteScalar() oCmd.Connection.Close()
6
1943
by: Kalim Julia | last post by:
Is it possible to open more than 1 datareader / dataadapter on one connection ? Is it possible to duplicate / clone connection ?
4
4363
by: scparker | last post by:
Hello, We have a stored procedure that does a basic insert of values. I am then able to retrieve the ID number created for this new record. We are currently using ASP.NET 2.0 and use N-Tier Architecture. The Stored Procedures are used through TableAdaptors, which in turn are used by Class Files. I wish to be able to return this new ID value using the Stored
3
23701
by: Sirisha | last post by:
Hi, I am inserting values into databse using sqlserver stored procedures. i wrote stored preocedure,but in codebehind file(.vb file) i dont know how to pass the parameters, i got error message like this "System.Data.SqlClient.SqlException: Procedure or Function 'sp_insert' expects parameter '@TestId', which was not supplied. at System.Data.SqlClient.SqlConnection" I wrote Stored Procedure Like this:
3
9849
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
Hi, Trouble in retaining values of dropdownlist, textboxes, and other controls when dropdownlist selectedindexchanged event is triggered, the controls are inside a user control and this user control inside a parent user control with an update panel. Can you guys help me hwo to retain the values. I have set EnableViewState to true. Where is correct page event to store entered and selected values before the values on controls are...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10112
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.