|
SIR,
I'm Sireesha. i want a report birthday of members by month wise , year wise .
Dim con As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim rs As New ADODB.Recordset
Dim MonthSql
Dim mon1 As String
Dim month1 As String
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\FBMDetails.mdb;Persist Security Info=False"
MonthSql = "select dob,md from fdetails"
mon1 = InputBox("enter month", "month")
Set rs = con.Execute(MonthSql)
rs.MoveFirst
While Not rs.EOF
month1 = Month(rs.Fields("dob"))
drMwr.Sections(1).Controls(5).Caption = mon
If month1 = mon1 Then
Dim monthsql1
monthsql1 = "select name,dob,md,phone,email from fdetails where month1 = ' " + mon1 + "' "
MsgBox (monthsql1)
rs1.Open monthsql1, con
Set rs1 = con.Execute(monthsql1)
Set drMwr.DataSource = rs1
drMwr.Show
End If
rs.MoveNext
Wend
i got an error:u> no value given for one or more required parameters in the statement rs1.Open monthsql1, con what to do sir how to solve this
Sireesha
|
|
|
|
|
|
Quote: monthsql1 = "select name,dob,md,phone,email from fdetails where month1 = ' " + mon1 + "' "
change your query(remove the spaces
monthsql1 = "select name,dob,md,phone,email from fdetails where month1='" + mon1 + "'"
|
|
|
|
|
spuritha wrote: no value given for one or more required parameters
Check your column names. You might have misspelled them.
|
|
|
|
|
The required parameters message normally means that one of the fields names in the SQL is spelt incorrectly.
Alternatively it could be a reserved word so you can try putting square brackets around the field name ie
select [name],dob,md,phone,email from fdetails
Name is a reserved field
|
|
|
|
|
How to disable program to run more than once?
It's funny when my login form appears twice when i accidentally enter the .exe twice..
thanks before,
|
|
|
|
|
Use a registry key or create a file which you can check when the program starts.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
using vb to create registry? possible?
why is my thread color became grey?
modified 28-Dec-11 4:13am.
|
|
|
|
|
vkstarry wrote: using vb to create registry? possible?
Certainly, see the Registry [^] class.
vkstarry wrote: why is my thread color became grey?
Because some moron has voted your question down because - well who knows what motivates these unicellular pieces of pond sludge.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
If you are using VB.NET, there is a checbox called "make single instance application" in application properties; checking it will do the trick for you.
|
|
|
|
|
|
All right i got it, thankyou to all of you..
|
|
|
|
|
Hello everybody,
hope you had a nice Christmas and happy holidays! Nevertheless, now I need your advice again
I used the designer to bind a SQL database to a DataGridView, and, actually, it works. But now I want to show the progress of retrieving the data rows in a progressbar - and don't find any event to trap for the 'UpdateProgress' procedure. The underlying datatable of the BindingSource turns out to be a "System.Data.Linq.Table(of T)" which doesn't seem to have a RowChanged event like a normal DataTable.
Can someone please help me to find my way out of this maze? (no philospohical background here )
Thanks,
Mick
|
|
|
|
|
Came across an interesting article today, and remembered a question here on CP looking for it.
Enjoy[^]
Bastard Programmer from Hell
|
|
|
|
|
good one.
|
|
|
|
|
|
Thank you Eddy for remembering!
I'll go over it tomorrow, for now I just wanted to wish you a Happy New Year!!!
|
|
|
|
|
Thanks, and best wishes for the coming year
Bastard Programmer from Hell
|
|
|
|
|
Hello,everyone!
I want to find a winform by its name in my project. At first, I thougt it could return the specific form with codes like below:
for each iForm as Form in XXX
return iForm
next
Is this right or not? If right, what's the collection included forms of project? If wrong, what should I do?
Would you give me some suggestions or demo?
Thanks!
|
|
|
|
|
if it is a visible form belonging to your own process, iterate the Application.OpenForms collection.
Otherwise, you will need to enumerate all the Windows windows using the EnumWindows[^] function (in user32.dll) using P/Invoke.
|
|
|
|
|
Thanks in advance,
I want to Update child nodes of a node, like in my XML document i have a node "Name", i want that it will search for its child Node "First_Name" having inner text "FN2" and then will update its Parents other child nodes like "Middle_Name" and "Last_Name".
I had asked this Question Here
www.codeproject.com/Questions/305565/how-to-Update-more-then-one-child-nodes-in-vb-net[^]
and got answer to obtain this Using LINQ , is there any other way to do this
Xml File
="1.0"
<Names>
<Name>
<First_Name>FN 1</First_Name>
<Middle_Name>MN 1</Middle_Name>
<Last_Name>LN 1</Last_Name>
<Country_Code>001</Country_Code>
<Area_Code>
</Area_Code>
<Phone_No>
</Phone_No>
<Email_Address>mail@email.com</Email_Address>
<Address>Address 1</Address>
</Name>
<Name ID="2">
<First_Name>FN2</First_Name>
<Middle_Name>Mn2</Middle_Name>
<Last_Name>Ln2</Last_Name>
<Country_Code>02</Country_Code>
<Area_Code>002</Area_Code>
<Phone_No>0002</Phone_No>
<Email_Address>email@mail2.com</Email_Address>
<Address>
</Address>
</Name>
</Names>
Code:
Function Edit() As Boolean
Try
'Dim xd As New XmlDocument()
'xd.Load(App_Path)
'Dim nod As XmlNodeList = xd.SelectNodes("//First_Name[. = '" & txtFName.Text & "']" & "/parent::node()/First_Name")
'If nod IsNot Nothing Then
' For Each node In nod
' 'nod.Item(0).ChildNodes(0).InnerText = txtMName.Text.Trim
' 'nod.Item(0).ChildNodes(1).InnerText = txtLName.Text.Trim
' Next
'End If
Dim xd As New XmlDocument()
xd.Load(App_Path)
Dim nod As XmlNode = xd.SelectSingleNode("//First_Name[. = '" & txtFName.Text & "']" & "/parent::node()/First_Name")
If nod IsNot Nothing Then
nod.ChildNodes(0).InnerText = "33"
nod.ChildNodes(1).InnerText = "333"
End If
Edit = True
Catch ex As Exception
MessageBox.Show(ex.Message)
ctlStatus.Text = "Current State : " & ex.Message.ToString
Return False
End Try
Return Edit
End Function
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
|
|
|
|
|
Use SelectNodes instead of the SelectSingleNode method to return a collection of nodes. See the MSDN Article Select Nodes Using XPath Navigation for more info.
The alternative to to create an XSLT
"You get that on the big jobs."
|
|
|
|
|
what is the error in the bleow: 'Public Event OnFilterAdded()' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
Imports System
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports Tawammar.CustomControls
Partial Class Filter
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
DataFilter2.DataSource = SqlDataSource2
DataFilter2.DataColumns = GridView1.Columns
DataFilter2.FilterSessionID = "Default.aspx"
DataFilter2.OnFilterAdded += (DataFilter2.OnFilterAdded + New
DataFilter.RefreshDataGridView(DataFilter2_OnFilterAdded))
End Sub
Protected Overrides Sub OnLoadComplete(ByVal e As EventArgs)
If Not Page.IsPostBack Then
DataFilter2.BeginFilter()
DataFilter2.AddNewFilter("Emp_ID", "Emp_Name", "Dav")
End If
End Sub
Private Sub DataFilter2_OnFilterAdded()
Try
DataFilter2.FilterSessionID = "Default.aspx"
DataFilter2.FilterDataSource()
GridView1.DataBind()
Catch e As Exception
End Try
End Sub
i know the erorr in
DataFilter2.OnFilterAdded += new DataFilter.RefreshDataGridView(DataFilter2_OnFilterAdded);
I have to use AddHandler statement but i dont know how i sepnt two days but Unfortunately I still new in VB programming
|
|
|
|
|
The += syntax for adding an event handler to an event is OK in C#, but it does not exist in VB.NET AFAIK.
You'll have to use an AddHandler statement, see the relevant MSDN page[^], or look it up in your VB.NET book.
|
|
|
|
|
Hi,
I'm searching for an example of an API hook for ExitWindowsEx.
I want to intercept the Shutdown/Restart of windows, do some stuff and go on with the ShutDown or Restart.
Ik know how to intercept the ShutDown with WM_QUERYENDSESSION but
that doesn't give me back which option the user has chosen: ShutDown or Restart.
I'v been searching the internet now for a few evenings with no results.
I'm using VB6 and VB2008. but any example would be appriciated.
Can anyone provide me with an example ???
Thank you !!!!
Ed
|
|
|
|