|
Hi...
I am used to VBA so bear with me.
I need to identify if a value from a Stored Procedure falls within a parameter using the "between" syntax. For example, show me all of the records that fall between February 1, 2005 and February 28, 2005.
My problem is one of syntax. I know how to have the Stored Procedure filter the records using a parameter. eg:
Me.daCostingRecSearchByVendor.SelectCommand.Parameters("@TravelDate").Value = CDate(Me.dtpCostingStarting.Value).Date
Not a problem... displays the values I want for a Date I have selected using a DateTimePicker on my form. Here is the twist. I have two DateTimePickers on this form and I want to have the parameter (@TravelDate) select values which fall between the them.
How do I adjust the syntax? I have tried various methods including <> or 'GreaterThanOrEqualTo'... nothing has worked for me so far.
Any advice would be helpful.
Thanks in advance...
Pat
|
|
|
|
|
You need two parameters One for the starting date of the interval, the other for the ending date
Select [mydate],[a],[b],[c],..., from [MyTable] where [mydate] >= ? and [mydate] <= ?
then
<br />
SelectCommand.Parameters("@startdate") = CDate(dtpCostingStarting.Value).Date<br />
SelectCommand.Parameters("@enddate") = CDate(dtpCostingEnding.Value).Date<br />
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Could some one please help me with the understanding how to pass the values to a drop downlist?
What i am tring to do is pass a parameter (@Likethis) from a selected item in a list box or a dropdown to a dropdown or a list box. I am assuming the i will have to attach the @Parameter to the selected item some how and in turn this will set off a stored procedured that will populate the dropdown,..
Please Help,
Erik...
=================I wanted to come back and add my code...
This is what i have been able to come up with.
Please let me know if i am on the right track
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'
Dim cnn As New SqlConnection("data source =desktop; initial catalog= northwind;trusted_connection=yes")
cnn.Open()
'
'You can modify it to
Dim da As New SqlDataAdapter("select * from customers", cnn)
Dim ds As New DataSet
da.Fill(ds, "Test")
'
ListBox1.DataSource = ds.Tables("Test")
ListBox1.DataValueField = "ContactName"
ListBox1.DataTextField = "ContactName"
ListBox1.DataBind()
End Sub
Private Sub dl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
'
If ListBox1.SelectedValue = "Hanna Moos" Then
ddl.DataSource = GetStuffForDDL("PrAmNaMe")
Else
ddl.Visible = False
End If
End Sub
Function GetStuffForDDL(ByVal PrAmNaMe As String) As SqlDataReader
'
'Begin The Madness
'
Dim cnn As New SqlConnection("Data Source= DeskTop; Initial Catalog=Northwind; Trusted_Connection=Yes")
Dim Mycmd As New SqlCommand("GettingParamForDDL", cnn)
'
'If ListBox1.SelectedValue = "Hanna Moos" Then
'End If
Dim PARMHannaMoos As String = "Hanna Moos"
'
Dim PramHannaMoos As New SqlParameter("@PARMHannaMoos", SqlDbType.VarChar, 50)
PramHannaMoos.Value = PARMHannaMoos
Mycmd.Parameters.Add(PramHannaMoos)
'
Mycmd.CommandType = CommandType.StoredProcedure
'
cnn.Open()
Dim Result As SqlDataReader = Mycmd.ExecuteReader(CommandBehavior.CloseConnection)
Return Result
cnn.Close()
Result.Close()
'
'End The Madness
'
End Function
End Class
|
|
|
|
|
I have a aplication using VB.net and CSGL for OpenGl. It works perfect on my computer, but when I try to install it on a computer where .Net is not installed the main window drawing does not work well( a grid drawn with OpenGL that is not displayed corectly, also gif on the main form are not displayed on some computers). On some computers it work on some not. All tested computers have the .NEt framework installed, via the MS updated. Installing .NEt via MS site does not solve the problem. ANy ideeas ?
|
|
|
|
|
pharao92 wrote:
but when I try to install it on a computer where .Net is not installed
The same version of the .NET Framework runtime MUST be installed otherwise your app wouldn't run at all.
Do these machines have an updated OpenGL library installed on them? Preferrably the same version you compiled against.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I have a form with 3 buttons. Cancel, Back and ok.
When the form Launches, depending on whether the form is the first one the Back button should be visible. My Problem is when its the first form, Back button is hidden and there is a space between Cancel and Ok.
I want to right align the cancel button. Is there a simple way of doing it ?
Thanks
|
|
|
|
|
Layout your form how you want it with the Back button displayed. Write down the Location values for each button. Now, layout the form how you want it without the Back button. Again, write down the Location values for the remaining buttons.
When your code that decides when to show, and not show, the Back button executes, change the Location values for the buttons to match how you want them laid out.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
A better way than writing down the location:
In code:
'after hiding the button<br />
btnCancel.Location = btnBack.Location
|
|
|
|
|
|
My front end is vb.net .Can i connect to a oracle db installed on linux as i do with oracle installed on windows
|
|
|
|
|
Of course! The DB server O/S doesn't make any difference to your application or the database provider its using.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I want to display those columns i get from list box to show on the crystal report.
User need to choose the item(s) from my list box and the system will display the whole column info in the crystal report.
fire85.
|
|
|
|
|
Well for Column I am not sure but there are sections in the report. you can make them visible true or false. may be this helps you for hiding columns.. check this code
Dim opt as new report1
' blnShow is my boolean variable to decided either to show the section or not
' dsEmployee is the section in the report
If blnShow = False Then
opt.dsEmployee.SectionFormat.EnableSuppress = True
End If
May be with this code you will find the way of hiding columns...
best of luck
|
|
|
|
|
I want to create a new thread and the attached method with previous thread has 2 params . How can I do that ?
Hung
|
|
|
|
|
This question is too general to provide much of an answer.
However a simple scenario for using threads is to design a class that contains the code needed to create and start the secondary thread. The same class also exposes all parameters needed by the secondary thread as properties.
The parent thread creates an instance of the class, sets all the required property values, then calls the class method to launch the secondary thread. The secondary thread runs whatever task it is supposed to run, and then notifies the parent thread either when it is done or the operation fails.
Notification can be by events (easiest) or by callback functions (more code reqiuired but generally a much better approach).
Robert
|
|
|
|
|
But I need the second thread must return the value. So, if I create new Class to run second-thread, how can I do that ?
Hung
|
|
|
|
|
Just create a module level variable for the return value, have the thread set the value and expose the value as a third public property. In this scenario, the parent thread creates the class, sets the two input parameter property values, starts the secondary thread execution, and when the parent thread is notified that the secondary thread has completed, it can read the return value from a third public property.
Robert
|
|
|
|
|
I have a designed a form which contains 5 Textbox.I have done OlEdb connection as a source code.When i click save button,the data will not be sending to the database ..please help me
|
|
|
|
|
what error occurs...and if possible send me the code ur using for saving the data into database..i do my best for the solution of ur problem.
|
|
|
|
|
i have about 3 pages in my ms word document. i want to set first and third page to portrait and second page to landscape.
anyone can help me?
|
|
|
|
|
Can you tell me the diffrency between A(,) and A()() ?
Hung
|
|
|
|
|
A(,) is a two dimensional array. A(5,2) will always have 5 lots of 2 elements.
A()() is a jagged array. A(5)() will contain 5 arrays of type A, each can be a different size.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello All,
I am trying to extend the GroupBox control. It compiles cleanly, but when I add a new control to a form (say GroupBoxNew) and then drag other controls onto its design surface, the other controls are added to the form's controls collection instead of to the GroupBoxNew controls collection.
Can anyone point me to what I am doing wrong? Thanks!
Have a great day!
j2associates_NO_SPAM_@yahoo.com
|
|
|
|
|
I don't know in detail your source code of the GroupBoxNew. However, I try creating GroupBoxNew simply by declaring a usercontrol which is inherited from GroupBox. As a result, I can manipulate on the GroupBoxNew like available GroupBox. I think that maybe you override some functions of the GroupBox during creating the GroupBoxNew. good luck to you! <vtalau>
|
|
|
|
|
Hi all,
I'm using VB.NET and I can read my XML into a dataset and display it into a DataGrid with no problem. But what I would like to do (if possible) is select certain elements via an id attribute.
For example, if my XML had the following nodes:
<br />
<mynode id="someid">innertext</mynode><br />
<mynode id="someid">someotherinnertext</mynode><br />
<mynode id="someid">more innertext</mynode><br />
<mynode id="someotherId">innertext</mynode><br />
How would I be able to display only those nodes with id="someid" and bind my dataset to my Datagrid.
Is this even possible to do or will I have to create another XML document to parse and hold only those specific nodes?
Any help would be much appreciated! Thanks.
|
|
|
|