|
BOREC wrote: Could it be that wildcard parameter search doesn't work because I use Express edition version of the program?
No. Parameters are such a basic feature that the Express edition includes it.
BOREC wrote: When I remove the apostrophes the wizard alerts: Erros in WHERE clause near '@'. Unable to parse query text.
Wizards!?! Why aren't you writing the code yourself. Wizards won't help you, they hinder you because they only allow limited functionality and produce inefficient code (they do produce correct code though which is their primary aim)
|
|
|
|
|
I would need a good example code to do that, otherwise I can't do it. I am not that good.
|
|
|
|
|
If no one has mentioned to this you before, please give your message titles meaning.
|
|
|
|
|
Daj cijeli kod.
HINT: nemoj radit sa drag & drop nacinom, odnosno koristiti kakve carobnjake kako bi izveo SQL query. Ako hoceš bit dobar programer, onda piši sve iz koda. npr. ja bih to bolje ovako izveo
dim dbconn as new system.data.sqlclient.sqlconnection(connectionstring)
dim query as string
dim sqlKomanda as system.data.sqlclient.sqlcommand()
dim reader as system.data.sqlclient.sqldataReader()
query = " taj tvoj query"
sqlcommand = new sqlcommand(query,dbconn)
reader = sqlcommand.executereader()
i sada manipuliraš reader objektom i iz njega izvlaciš podatke...
itd...
Nadam se da sam bio od pomoci.
Pozdrav iz Bjelovara.
|
|
|
|
|
I'm kinda thinkin' you want it to look like this:
BOREC wrote: WHERE (Priimek LIKE '''%' & @NAME & '%''')
Tom
|
|
|
|
|
hi there,
i hav a prob that i have resource file in 3 diff languages
first one is English second one is German and third one is French
when app runs it automaticaly loads the English resources as i m using an English OS and also it is the first table, i want to load resources other than English i.e. the german and french which ever is desired,
One way of doin this is maintain a language off set and put all the three diff lang resources in single file it works fine but i want it the other way i.e. maintaing diff tables for diff lang resources and loading the desired one.
Any suggstions will do a great favour to me
Thanks & Regards
Faisal Ch Mehmood
i m faisal
|
|
|
|
|
|
Please, Help me if anybody can!!!!!
I want to generate own Report from my project,not from Crystal report Software.
I used following control in VB6 to generate Crystal.
CRViewer.This control can get Crystal Report Viewer component.
Like this VB6 code,i am using this control in VB.Net,
Friend WithEvents crvReport As CRVIEWERLib.CRViewer
Me.crvReport = New CRVIEWERLib.CRViewer
And my form has Preview command button to preview own report from this form.If user click this Preview button ,user can preview his own report.For
this ,i am using this code in cmdPreview_Click().
Call frmpReport.ShowReport(m_astrType, m_strColumn, m_aintWidth, m_astrFSource, blnSave)
,but my project face with problem in this line.
Call frmpReport.ShowReport(m_astrType, m_strColumn, m_aintWidth, m_astrFSource, blnSave)
Error Message is
Unable to cast COM object of type 'CRVIEWERLib.CRViewerClass' to interface type
I will waiting for your answer.THANKS For ur Answer.
|
|
|
|
|
Don't post the same thing over and over. Give people time to reply, if they know the answer to the problem.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi there
I've started using web services in VB.net, and it works great; I'm actually not creating the web services themselves, rather calling them from my Windows Form application. I use the "add web reference" function, and everything works great for simple services which take parameters such as string, double, datetime etc. and return a string. I now need to use a bunch of services which take a "MAP" as parameter, which from what I understand is an array of string parameters. The MAP class has only two properties, Key and Item.
I haven't managed to input the parameters, cauz I don't know where to start. I've tried as follows
Dim Map As New WebServices.WebServicePerformance1.Map<br />
<br />
Map.item(0).value = ptfCode<br />
Map.item(1).value = "VL_BASE100_DTD"<br />
Map.item(2).value = "codeTypePart"<br />
Map.item(3).value = "PTF_INDICES"<br />
Map.item(4).value = "0"<br />
<br />
Dim Res As String = Perf.calculReportMultiDevise(Map)<br />
<br />
Return Res
I have a working sample in Excel VBA, which goes as follows:
Sub getValorisationPtf_bench(codeTypePart As String, ptfCode As String, typeindices As String, deviseCalcul As String, periodicite As String, startDate As String, endDate As String, colonneAffiche As String, startRowIndex As Integer, startColIndex As Integer)<br />
<br />
Dim Connector As SoapConnector<br />
Dim Serializer As SoapSerializer<br />
Dim Reader As SoapReader<br />
<br />
<br />
Set Connector = New HttpConnector<br />
Set Serializer = New SoapSerializer<br />
Set Reader = New SoapReader<br />
' construction du message Soap<br />
Connector.Property("EndPointURL") = URL<br />
' Connector.Property("ConnectTimeout") = 120000<br />
Connector.Property("Timeout") = 300000<br />
Call Connector.Connect<br />
Connector.Property("SoapAction") = URIPERF & "#" & "calculReportMultiDevise"<br />
Call Connector.BeginMessage<br />
<br />
Serializer.Init Connector.InputStream<br />
<br />
Serializer.StartEnvelope , ENC<br />
Serializer.SoapNamespace "xsi", XSI<br />
Serializer.SoapNamespace "SOAP-ENC", ENC<br />
Serializer.SoapNamespace "xsd", XSD<br />
<br />
' Construction des paramètres d''appel<br />
Serializer.StartBody<br />
Serializer.StartElement "calculReportMultiDevise", URIPERF, , "ns1"<br />
Serializer.SoapAttribute "EncodingStyle", , "http://schemas.xmlsoap.org/soap/encoding/", "SOAP-ENV"<br />
Serializer.StartElement "Code", "http://xml.apache.org/xml-soap", , "ns2"<br />
Serializer.SoapAttribute "type", , "ns2:Map", "xsi"<br />
addMessageEntry Serializer, "codeActif", ptfCode, "xsd:string"<br />
addMessageEntry Serializer, "codereq", "VL_BASE100_DTD", "xsd:string"<br />
addMessageEntry Serializer, "typepart", codeTypePart, "xsd:string"<br />
addMessageEntry Serializer, "typecalcul", "PTF_INDICES", "xsd:string"<br />
<br />
Serializer.EndElement<br />
<br />
Serializer.StartElement "colonneAffiche"<br />
Serializer.SoapAttribute "type", , "xsd:string", "xsi"<br />
Serializer.WriteString colonneAffiche<br />
Serializer.EndElement<br />
<br />
Serializer.EndElement<br />
Serializer.EndBody<br />
Serializer.EndEnvelope<br />
<br />
Connector.EndMessage<br />
<br />
Reader.Load Connector.OutputStream<br />
<br />
If Not Reader.Fault Is Nothing Then<br />
MsgBox Reader.FaultString.text + " not reader ", vbExclamation<br />
Else<br />
'parseDom Reader.Dom, startRowIndex, startColIndex<br />
displayValoPtfbench Reader.Dom.text, colonneAffiche, startRowIndex, startColIndex<br />
End If<br />
<br />
If Not Reader.Fault Is Nothing Then<br />
MsgBox Reader.FaultString.text, vbExclamation<br />
End If<br />
<br />
End Sub
From my poor understanding it's serializing an XML file, but I do not know how to do that in .net. I'm pretty sure there is a simple way in .net than in VBA, without calling the connection, data reader etc., as I already have the proxy classes automatically generated.
Anybody capable of helping me get that up and running in .net??
Many Thanks in advance...
JM
|
|
|
|
|
In the VBA code you supplied, it appears that "Map" is a collection of key/value pairs (built using the addMessageEntry calls.) You've added the values in your VB.NET code, but not the keys they go to ("codeActif", "codereq", ...) So, in your VB.NET code, you'd do something like:
Map.Add("codeActif", ptfCode.ToString())
Map.Add("codereq", "VL_BASE100_DTD")
Map.Add("typepart", codeTypePart.ToString())
Map.Add(typecalcul", "PTF_INDICIES")
Mind you, this is just a guess, since you haven't provided anyn details about what a "Map" object is. I'm guessing that it represents a collection of key/value pairs, judging by the VBA code...
|
|
|
|
|
I want the DataGridView to select for methe row that contains 1234 in CustomerID column.
thanks
Shimi
|
|
|
|
|
Can you be more specific.
what is methe?
Shay Noy
|
|
|
|
|
|
this worked:
Private Sub ctlSpan_TextChanged(ByVal sender As Control, ByVal e As System.EventArgs) Handles ctlSpan.TextChanged<br />
With CustomersDataGridView<br />
If .Columns.Contains("CustomerID") Then<br />
For Each row As DataGridViewRow In .Rows<br />
If row.Cells("CustomerID").Value.ToString = sender.Text Then<br />
If row.Cells("CustomerID").Value IsNot Nothing Then<br />
If Not row.Selected Then row.Selected = True<br />
End If<br />
End If<br />
Next<br />
End If<br />
End With<br />
End Sub
Shimi
modified on Sunday, December 30, 2007 11:39:28 PM
|
|
|
|
|
I've been trying to get this to work for weeks now without success.
I have two rich text boxes on my form and I'm trying to create a load_event so that
each one of the rich text boxes reads from a different text file saved on the root of C drive.
The richTextBox1 is working fine but richTextBox2 is not? What am I doing wrong?
Also, when F5 key is pressed(shortcut for MainMenuItem1) the following needs to happen:
the time stamp is put into whichever box has focus and the contents of that box need to be written
to a text file on C drive. All of this is working fine for richTextBox1 but not for richTextBox2.
Can anyone please help me??? I would greatly appreciate it!
Thanks, Hedo
Public Class Form1
Inherits System.Windows.Forms.Form
Dim firsthasfocus As Boolean
Dim secondhasfocus As Boolean
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2})
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.Shortcut = System.Windows.Forms.Shortcut.F5
Me.MenuItem1.Text = "DateTimeStamp"
Me.MenuItem1.Visible = False
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
If firsthasfocus Then
richTextBox1.Text = richTextBox1.Text & " " & Now & " "
ElseIf secondhasfocus Then
RichTextBox2.Text = RichTextBox2.Text & " " & Now & " "
Dim richTextBox1 As New RichTextBox
End If
Dim FILE_NAME As String = "C:\textfile1.txt"
If System.IO.File.Exists("C:\textfile1.txt") = True Then
'The following line of code will overwrite the log with the current
'contents of the text box(when F5 key is pressed),
'if you wish to append(add) text instead of
'overwriting it then just add "True" in the parenthesis after the path
' so it looks like this("C:\textfile1.txt", True)
Dim objWriter As New System.IO.StreamWriter("C:\textfile1.txt")
objWriter.Write(richTextBox1.Text)
objWriter.Close()
MsgBox("Saved")
Else
MsgBox("File Does Not Exist")
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim FILE_NAME As String = "C:\textfile1.txt""C:\textfile1.txt"
If System.IO.File.Exists("C:\textfile1.txt") = True Then
Dim objReader As New System.IO.StreamReader("C:\textfile1.txt")
RichTextBox1.Text = objReader.ReadToEnd
objReader.Close()
End If
If System.IO.File.Exists("C:\textfile2.txt") = True Then
Dim objReader As New System.IO.StreamReader("C:\textfile2.txt")
RichTextBox2.Text = objReader.ReadToEnd
objReader.Close()
Else
MsgBox("File Does Not Exist")
End If
End Sub
Private Sub RichTextBox2_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox2.GotFocus
secondhasfocus = True
firsthasfocus = False
End Sub
|
|
|
|
|
If I understood you right, this is the solution (Copy and paste):
Option Explicit On
Public Class Form1
Inherits System.Windows.Forms.Form
Dim firsthasfocus As Boolean
Dim secondhasfocus As Boolean
Const File1 As String = "C:\textfile1.txt", File2 As String = "C:\textfile2.txt"
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
If firsthasfocus Then
RichTextBox1.Text &= " " & Now & " "
If System.IO.File.Exists(File1) = True Then
Dim objWriter As New System.IO.StreamWriter(File1)
objWriter.Write(RichTextBox1.Text)
objWriter.Close()
MsgBox("Saved in " & File1)
Else
MsgBox("File " & File1 & " Does Not Exist")
End If
ElseIf secondhasfocus Then
RichTextBox2.Text &= " " & Now & " "
If System.IO.File.Exists(File2) = True Then
Dim objWriter As New System.IO.StreamWriter(File2)
objWriter.Write(RichTextBox2.Text)
objWriter.Close()
MsgBox("Saved in " & File2)
Else
MsgBox("File " & File2 & " Does Not Exist")
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If System.IO.File.Exists(File1) = True Then
Dim objReader As New System.IO.StreamReader(File1)
RichTextBox1.Text = objReader.ReadToEnd
objReader.Close()
Else
MsgBox("File " & File1 & " Does Not Exist")
End If
If System.IO.File.Exists(File2) = True Then
Dim objReader As New System.IO.StreamReader(File2)
RichTextBox2.Text = objReader.ReadToEnd
objReader.Close()
Else
MsgBox("File " & File2 & " Does Not Exist")
End If
End Sub
Private Sub RichTextBox2_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox2.GotFocus
secondhasfocus = True
firsthasfocus = False
End Sub
Private Sub RichTextBox1_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.GotFocus
secondhasfocus = False
firsthasfocus = True
End Sub
End Class
Shay Noy
|
|
|
|
|
Wow! That's it. Your code works. Thanks a lot!
Thanks for the super fast response.
You've just saved me a lot of time.
I do have a few more questions.
1. How do I automate the process of creating the file1 and file2 at startup (load_event) so that I don't have to create them manually: at startup, check if file1 and file2 exists, if true, read from file1 and file2, if false, create file1 and file2. I know how to explain it but how do you say it in code?
2. How do I append logs for 30 days, on day 31, delete (or overwrite) log for day 1, on day 32 delete (or overwrite) log for day 2 and so on...
so that I always have logs for the last 30 days from today and at startup only load the latest(newest) log.
3. How do I put a calendar under a search button so when the search button is clicked, a calendar pops up and you pick a date and the log for file1 or file2 for that day gets loaded into the rtf box. I also need another button that lets you return to the current (last) log.
4. If I have a drop down menu on the form and collection items are: Up, Down, Left, Right, Front, Back and I have "Up" (or any other one) selected and the application gets closed, how do I save the setting so that when the form is loaded again, it shows the same selection it had before it was closed?
Thanks for your time.
|
|
|
|
|
Dear,
Is there anyone to give some suggestions for me? In my project, I would like to detect whether the mouse is tracking or not. I don't care where the mouse position.
First, I use Form_MouseMove function, but it can't sense when the mouse pointer arrives out of Form. Second, it can be sensed while using GetMousePos API, but it can't sense while the pointer arrive the boundary of the screen although the mouse is still jogging.
Can I sense that movement from the system? How can I write the code in VB 6.0?
Best Regards,
zawpai
|
|
|
|
|
I can't remember if this is going to apply to VB6 or not, but...
Handle the Form's MouseLeave event and you'll know when the mouse leaves your form. As for getting the mouse information after that, you'll probably have to run a Timer to fire off some code that gets the mouse position and compares it to the known coordinates of the edges of the screen. You'll probably need to use the GetMousePos function to get what you need.
You'll have to call the GetSystemMetrics[^] function to get the screen dimensions.
|
|
|
|
|
|
First, read this post[^].
I'm not looking through all that garbage to find the relevant code. Most of it's Java and the text for an agreement - hardly relevant to any VB.NET related questions.
Second, I have no idea what your question is...
|
|
|
|
|
Don't delete messages after someone has replied.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
I'd like to export specific columns into certain positions in the textfile, can you show me how?
For example - loop through row, exporting into textfile:
column 1 ---> start on 1st line Position 20 in the text file (after 19 spaces)
column 2 ---> beginning of next line.
column 3 ---> (after 39 spaces), position 40.
__________________
I know how to set get the whole line, but how to get specific values from each row.
Here's what i have that extracts all (just a snippet of my code). Please help
For rowIndex = 1 To 50
colIndex = 1
If Not (CType(oWS.Cells(rowIndex, colIndex), Excel.Range)).Value2 Is Nothing Then
For colIndex = 1 To 15
If (CType(oXL.Cells(rowIndex, colIndex), Excel.Range)).Value2 Is Nothing Then
sWrtier.Write("" + vbTab)
Else
sWrtier.Write((CType(oXL.Cells(rowIndex, colIndex), Excel.Range)).Value2.ToString() + vbTab)
End If
Next
End If
|
|
|
|
|
What is the problem?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|