|
Hi friends,
I am a C Developer. Now i assigned to a new project which has front end as vb, Application layer is C++ and back end is sql server. since i am new to these platforms i am trying to implement the application using this.
i tried one small application using our company's already written api. for example, i had created a front end with two text boxes, and when i try to save the record, its showing run time error like, "method 'insert' of object 'datasource' failed". i just want to know the reason why these error showing? and how to rectify it?
|
|
|
|
|
Welcome to the VB.NET forum. I suggest you post your question in a more relevant forum, including a code-snippet of the code that throws the error.
|
|
|
|
|
Dear(s)
I somehow stuck. Pleaes help me in this regard.
I am trying to incorporte Arabic language support in my application. I have done the following.
1. Took Textbox with Arial Unicode MS Font and Arabic charset.
2. At backend I change my field to NVARCHAR to hold unicode.
Alls went well execpt, When i took input in arabic from user, the textbox gives me this ÚÇãÑ ÑÔíÏ after taking input. I ll try to convert it into string but fail.
And in SQL Server the Insert statement saves the same it get from textbox not the arabic text.
Please help me in this regard
Ahsan Sheraz
|
|
|
|
|
The VB.NET IDE is available for free, as is the runtime. I strongly suggest you switch your platform. VB6 is no longer actively supported.
To make the decision easier; this is a problem with text-encodings. VB.NET would convert it to UTF and be done with it - no more "weird characters".
|
|
|
|
|
Dear Brother
Thanks very much for your reply, but I am working on an ERP having 7 fully functional modules, I cannot switch over right now the platform. Please help me.
Let me tell you this junk is displaying correct value in text box or crystal repots having font supports arabic charset. But at the time of saving in (Insert statement) textbox.text gives me this junk, How can I play with them.
Thanks in advance
ahsan sheraz
|
|
|
|
|
There's nothing to play with. First, VB6 was know to have bad support for Right-to-Left text.
But, the textbox will display any text it's given, provided the font being used supports the appropriate characters. It'll look like junk if the font doesn't support it. So, where exactly are you seeing this "junk"?
|
|
|
|
|
Member 9707221 wrote: Dear Brother
I'm neither.
Member 9707221 wrote: Let me tell you this junk is displaying correct value in text box or crystal repots having font supports arabic charset. But at the time of saving in (Insert statement) textbox.text gives me this junk, How can I play with them.
Like I said, it's a dead language. If you want to use it, you'll be doing a lot of archeology.
http://blogs.msdn.com/b/vsarabic/archive/2012/04/05/install-arabic-vb6-applications.aspx[^].
|
|
|
|
|
i want to use class Win32_DefragAnalysis(WMI) to scan status of other volume, but it is not active, exactly, the For-each is not work, please help me,
<pre lang="vb">Private Sub defrag_analysis()
On Error Resume Next
Dim item
Dim nameSQL
Dim wmiOBJECT
Dim itemCOLLECTION
Set wmiOBJECT = GetObject("Winmgmts:\\.\root\cimv2")
nameSQL = "select * from Win32_DefragAnalysis" ' Where VolumeSize > 0 "
Set itemCOLLECTION = wmiOBJECT.ExecQuery(nameSQL)
For Each item In itemCOLLECTION
'not print properties of item
MsgBox "VolumeSize : " & item.VolumeSize
MsgBox "Name : " & item.VolumeName
MsgBox "FreeSpace :" & item.FreeSpace
MsgBox "AverageFileSize : " & item.AverageFileSize
Next
MsgBox "jump here"
End Sub
</pre>
|
|
|
|
|
Since when does VB6 have a "for-each"? Did I mention it's a dead language? Why are you still using it?
The VB.NET IDE is available for free, as is the runtime. I strongly suggest you switch your platform.
|
|
|
|
|
Hi, I need some help on printing data on a listview having 20 columns of data, how do i do that
|
|
|
|
|
|
code for puzzle game having 9 comand buttons using if statement
|
|
|
|
|
No one is going to just give you code. You must present what you have done so far and describe where you need assistance, then they might show you a way to solve your problem.
Good luck.
|
|
|
|
|
|
Does anyone have a code for VB program to set the time example 30 minutes could turn off the Internet (ADSL), much like internet cafes?
|
|
|
|
|
And you expect someone to just hand over their hard work for you to turn in as your own??
|
|
|
|
|
|
In that case, you'll be writing a proxy server. When a client connects to the proxy for the first time, you record the current time. Every time the client makes another request, you check the current time against the one that was recorded on first connection. Greater than 30 seconds? Don't forward the request to the destination server.
|
|
|
|
|
Cannot get instr function to work .net?
Using VB.net
For some reason, the 'instr' function and the 'string.indexof' is the same.
The problem is that one of the 2 string arguments, is a variable that is passed from the calling subroutine (not the literal characters) and it does not recognise the 'match'.
When I type in the literal characters with " " -- it works ok.
Here is a copy of the line that is not working.
'm' is the positional marker / 'largetxt' the body that is being searched and 'smalltxt' is the string that is being searched for.
intx = InStr(m, mainTxt, smallTxt)
The variable 'smallTxt' is the problem ---- if I have:
intx = InStr(m, mainTxt, "house") --- it works ok
Also ... same thing for:
intx = largeTxt.IndexOf(smallTxt, m)
Cheers
|
|
|
|
|
InStr is only there for converted VB6 code. It's been deprecated. Use string.IndexOf() instead.
Without seeing the contents of the variables, it's impossible to tell you why it isn't working with any confidence. These functions are case-sensitive, so that might be your problem, but...
|
|
|
|
|
Here is a sample for you...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim maintext As String
Dim smalltext As String
Dim foundpos As Integer
Dim startpos As Integer
startpos = 0
maintext = "Jack and Jill"
smalltext = "and"
foundpos = maintext.IndexOf(smalltext, startpos)
If foundpos > 0 Then
MsgBox("match found at character " & foundpos)
Else
MsgBox("no match found")
End If
End Sub
|
|
|
|
|
Thank you both .
It the 'indexof' function also not working .... it gives a true result may one time in 20 (when I know it is a true hit).
I think there may be a bug in vb.net. It doesn't matter what I do, it comes up with -1 all the time.
|
|
|
|
|
Is there an alternative method ?.... .... I could spend 5 years tyring to get this one working - it's driving me crazy.
|
|
|
|
|
Yes theres INSTR,
If INSTR(Look-in-this-string", "For-This-String") > 0 Then
'REM A Match Was Found
Else
'REM No_Match_Was_Found
End If
and if you assign the result to a variable then the variable will give you the position...
LocationId = INSTR(Look-in-this-string", "For-This-String")
If LocationId > 0 Then
'REM A Match Was Found
Else
'REM No_Match_Was_Found
End If
|
|
|
|
|
.NET is a widely used framework, and looking for the position in a string is something most of us do. If there was a bug, it'd be found by now.
For these types of bugs, the answer is that "SELECT is not broken".
|
|
|
|