|
hello
I want to know why this error "Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException'.
now i'm tracing why this error occurr, but can't find yet.
if someone has experience with this error, please help me and send me message.
phoopwint
flowerppk
|
|
|
|
|
AxHost is a class that hosts ActiveX (COM) components on your form. You have a COM-based control that you added to your form that is misbehaving.
|
|
|
|
|
Dear programmers,
Can anyone give me the code to make the data displayed in the datagrid or HFlexGrid editable and then save that in the database.
I urgently need that for my project in the job.
Thanks one and all
Keshav Singh Developer in C++ and VB
|
|
|
|
|
Keshav Singh Sunwar wrote: urgently
Very impolite.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi Paul,
Keshav here to whom you replied a few hours back. I m extremely sorry for the words I used in my message.
Actually I need to do the same at any cost before this weekend, that was the reason 4 the message.
I am trying to make datagrid editable by inserting a textbox on the click event of the Flexgrid for each cell clicked.
I hope it will work out.
Thnx for the message
keshav
Keshav Singh Developer in C++ and VB
|
|
|
|
|
I think Dave's reply is the better one
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
This[^] is about the best information you're going to get on creating an editable MSFlexGrid.
|
|
|
|
|
I am using VB 2005. trying to create wilcard parameter search. I don't know how to connect variamble Name to the one using in SQL statements.
SQL lines in Query builder:
SELECT ID, Ime, Priimek, [Službeni telefon], [Službeni GSM], [Domaci telefon], [Privatni GSM], [Elektronska pošta], [Domaci naslov]<br />
FROM SLUŽBA<br />
WHERE (Priimek LIKE '%' & '@NAME' & '%')
And in Form2 I have this code inside button1 object:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
Dim NAME As String<br />
<br />
NAME = TextBox1.Text<br />
<br />
<br />
Try<br />
Me.SLUŽBATableAdapter.FillBy2(Me.TelefonskiImenikDataSet.SLUŽBA, NAME)<br />
Catch ex As System.Exception<br />
System.Windows.Forms.MessageBox.Show(ex.Message)<br />
End Try<br />
End Sub
can anyone tell me what is wrong here and correct the code, please.I've b een researching a lot and don't find a proper solution. Please Help. The builder doesn't report any error but the button doesn't do a query parameter wildcard search. Variable NAME is underlined with green waveline.It says too many arguments to function FillBy2.
|
|
|
|
|
BOREC wrote: '@NAME'
Remove the apostrophes around the parameter. The apostrophes tell SQL Server to expect a string literal value.
|
|
|
|
|
Could it be that wildcard parameter search doesn't work because I use Express edition version of the program?
When I remove the apostrophes the wizard alerts: Erros in WHERE clause near '@'. Unable to parse query text.
I tried a lot ways to create a FillBy2 function with apropriate SQL statements and then call the function in Button_click subroutine but it doesn't work. Has anyone done this at home or office?
Can someone post the whole code so I can analyze it. Comments very welcome.
Bye
|
|
|
|
|
You can pad the value entered by user with '%' before sending it as parameter, ie
1. User type in 'abc'
2. In your code, pad the value to '%abc%'
3. Set the padded value to the parameter.
So your selection will just be:
WHERE (Priimek LIKE @NAME)
By the way, your original selection statement always search for '%@NAME%' <-- no longer a parameter.
|
|
|
|
|
I understand this. But what puzzles me is that when I create parameter search using this SQL statement
SELECT...
FROM ...
WHERE ( Priimek = ?) the wizard automaticaly creates a function FillBy
the wizard automaticaly creates a function FillBy(Priimek) With a variable Priimek which I can use in this statement
Me.SLUŽBATableAdapter.FillBy2(Me.TelefonskiImenikDataSet.SLUŽBA, PriimekToolStripTextBox.Text)
But when I create a function with SQL statement
WHERE (Priimek LIKE @NAME)
I get a function with no parameter. The wizard simply puts it out as FillBy2()<-no parameter.
I want to create a parametrized wildcard search. When I write "Klaj" out of "Klajnšek" Lastname in TextBox1 I want that the program displays all records with letters "klaj" in LastName like "Klajnšek" or like "Priklajdorin". I hope you understand.
Thank you for help
modified on Thursday, December 27, 2007 7:55:50 AM
|
|
|
|
|
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
|
|
|
|
|