|
hi,
how to check whether duplicate values are present in a dataset.i have to check whether the combination of 2 fields in the dataset does not repeat.for eg.name and rollno.
i have done it using For loop.if anyother way pls help me.
|
|
|
|
|
You'd do better to set constraints on your data source so this can't ever happen.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi guys
I want to set Internet Explorer Printer Page Setup options Paper Source, Size etc. programatically, kindly help me in this regard.
Thanx in advance.
|
|
|
|
|
I am still a little new to vb.net and I tried to print to the printer like I did in vb6 and it has changed I have done some research on this and found some tutorials but with no luck on what I am looking for. An ex. of the code would be like Printer.Print "Whatever" but when i go Printer.Print("Whatever") it gives me an error message. If someone could help me out with this I would really appreciate it. Thank You for you time.
B.
|
|
|
|
|
Bso_Cool wrote: I have done some research on this and found some tutorials but with no luck on what I am looking for.
Looks[^] to me like there are lots of tutorials.
Bso_Cool wrote: but when i go Printer.Print("Whatever") it gives me an error message.
I guess that's why no tutorials tell you to do this, it's changed from VB6.
I suggest following any of the tutorials I brought up with google, or asking a more specific question about the nature of what you want to print.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to drag Image and Image will follow cursor until we drop it.
Such as we drop it in Panel Area
(Like when you drag "Textbox" Control and Place to Designing Form in Visual Studio)
I do it and have problem with Mouse Position
I don't find Cursor Location when I over Panel Area
I use VB.NET 2005
|
|
|
|
|
The easiest way to do this is to draw the image yourself on the screen, no picture box. If you want to do drag and drop, impliment it as drag n drop ( that is, use the messages provided by the framework ), and set the cursor of the controls you can drag over, including the main window, to be one you create of the image in question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi i placed 2 richtextboxes and one button on a form
1st richtextbox named "result"
2nd richtextbox named "text1"
i want when i click on button,then it search the word "abcd" in text1.text, if found then write result.text in text1.text in second line("abcd" may be in any line)
so i coded on button :
If InStr(Text1.Text, "abcd") Then
text1.Text = text1.Text + InStr(text1.Text, "abcd") & Microsoft.VisualBasic.ChrW(13) + result.Text
End If
but it gives error that
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Cast from string "abcd" to type 'Double' is not valid.
|
|
|
|
|
Are you sure that the error message comes from the code that you have shown? The only thing that seems relevant in the error message is the string "abcd", unless of course if you created your own InStr function.
---
b { font-weight: normal; }
|
|
|
|
|
|
I see. Yes, perhaps your strange code might produce that error, but I am not really sure how. Perhaps the compiler got confused by all your implicit conversions, and tried to convert everything to the number with the largest capacity, which is a double.
If you use a bit less implicit conversions, I'm quite sure that it might work better. The InStr function returns an integer, not a boolean and not a string. If you want to concatenate strings, either stick to the & operator, or make sure that what you are concatenating is really strings.
---
b { font-weight: normal; }
|
|
|
|
|
ok so can you tell the codes which will work?
|
|
|
|
|
I just explained some problems with your code. Can't you at least make an attempt to fix them before asking me to do the work for you?
---
b { font-weight: normal; }
|
|
|
|
|
man i tried about 50 times and every angle but no benfite then i wrote my problem in this forum
|
|
|
|
|
The "+" signs cannot be used to concatenate strings together. You MUST use "&" signs. Also Instr is deprecated. I think it's replacement is String.IndexOf[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: The "+" signs cannot be used to concatenate strings together. You MUST use "&" signs.
That is not true at all. The + operator can be used to concatenate strings just fine. The & operator is used when you concatenate values that doesn't need to be strings, but you want them to be converted to strings first.
Dave Kreskowiak wrote: Also Instr is deprecated. I think it's replacement is String.IndexOf[^].
Not really deprecated. It's one of the functions in the Microsoft.VisualBasic assembly for simplifying the transition from VB 6.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: That is not true at all.
True, but that's what happening in this case. I'm telling him that to keep him locked into putting string together with one operator (&) and doing math with the other. What's happening in his code is that the cast is failing because the value of Text1 or Result, appearing to be "abcd", is failing a conversion to Double so it can be added to the result of InStr which returns a number.
Guffa wrote: Not really deprecated. It's one of the functions in the Microsoft.VisualBasic assembly for simplifying the transition from VB 6.
I hate that we even have to do this!!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: I'm telling him that to keep him locked into putting string together with one operator (&) and doing math with the other.
So you tell a lie to make him write code in a certain way? Don't you think that the truth might have the same effect?
Or do you think that you need to be an MVP to handle the truth? For beginners it's the blue pill?
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: So you tell a lie to make him write code in a certain way?
My mistake. But, I don't see it as more than a "little white lie" though.
If putting down rules like that helps them learn the language and keep their code a little more maintainable until they learn those little idiosynchrocies, I'm all for it!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
oh man(Dave Kreskowiak) its working when i change "+" to "&" but when
i wrote "1234" in result.text and "abcd" in text1.text
and when i click on button then this appeared in text1.text:
abcd1
1234
and when i click again then this appeared:
abcd1
12341
1234
i want to know that from where the "1" coming?
|
|
|
|
|
Look at what your stringing together to get this:
text1.Text = text1.Text & InStr(text1.Text, "abcd") & Microsoft.VisualBasic.ChrW(13) & result.Text
First first part:
Text1 = The text in Text1 & Instr(blah,blah) & ...
This say take the existing text in Text1 and append the value returned by InStr, which returns a number 0-n. This is what's giving you the abcd1 and returning an ever longer string in Text1.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
so man can you tell the right code for it?
|
|
|
|
|
For what? I have no idea what you want it to do!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
ok end this topic , i will solve it
|
|
|
|
|
I work by VB.6 and I want to make a project that project should know the DIR of The windos and The DIR of the System32 file outomaticaly . How can I do that? Is there a code I can Use it to get the windows DIR and the system32 file DIR or not?????????????
Thank You For Help
soly
|
|
|
|