|
|
Hello,
Which Exception appears when inserting duplicated data (primairy key) in a database?
In my application "System.Data.OleDb.OleDbException" appeared but that seems to general to me??
And how can i use the try, catch statement?
Thanks
|
|
|
|
|
That looks about right, it's a database exception, and there are not exceptions defined for everything that can happen in the DB. The text of the exception will explain it
keninfo wrote: And how can i use the try, catch statement?
If you really don't know how to use try/catch, you probably need to buy a book on VB and work through it. Or, at least try google.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I know a little how try catch is working but can you help me a little ?
|
|
|
|
|
Try
' do your processing here
Catch (WhateverException As Exception)
' handle the error here
Finally
' any additional processing that needs
' doing regardless of error handling
' release database connections, etc.
End Try
Read this[^] for more info.
|
|
|
|
|
Well, I assume you knew what you've been told ( as it's the bare bones of what try/catch does ). What did you need to know ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How to get the current page number in ms word using vb.net.
i like to get the hyperlinks count in each page including the footnotes hyperlink and to store in an array
Thanks,
Nanda
|
|
|
|
|
i am trying to test the c dll in vb. but while calling the function it is giving me the follwing error.
Unhandled exception at 0x77f75a58 in Project1.exe: User breakpoint
the call from vb is like:
Dim buf As String
Dim xml As Long
buf = " "
xml = xmlnode_GetXml(root, buf, 10000)
and the code in c is like:
long __stdcall xmlnode_GetXml( XMLNODE xnode, char* pBuffer, long lBuflen )
{
std::string s = ((XMLNode*)xnode)->xml();
long l = (long)s.length();
if( pBuffer && lBuflen>0 )
{
memcpy( pBuffer, s.c_str(), (lBuflen
|
|
|
|
|
You have to allocate the right amount of memory for your buffer variable.
For instance:
Const lBufSize=10000
Dim buf as String * lBufSize
xml = xmlnode_GetXml(root, buf, lBufSize)
I used a const to highlight the requirement that buffer size must match the one passed to the called function.
Hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Hi all,
By using MSCOMM control i am able to make a phone call.But It requires Modem &
Phone.Is there any way of avoiding Modem,Is it Posible to make a phone call without using modem ? Please give me suggetions for this .
Thanks & Regards
Raju.
|
|
|
|
|
It depends on how you want to connect.
If you are using a PABX you need a TAPI driver from the vendor and make an application which instructs the TAPI driver.
This is called CTI(Computer Telefony Integration) and CSTA (Computer Supported Telefony Application).
Regards,
Bas
|
|
|
|
|
Hi,
I Get the Table values from sql server 2005 and display it in a DataGrid View in VB.NET 2005 Now I want to Add new record and Edit the values of existing one.
How to do it? Give me sample code..
Thanks in Advance
|
|
|
|
|
Hi, can anyone tell me how to disallow setting a property at run time like that of the Style property of a ComboBox where we are allow to set the style at design time but not via code.
|
|
|
|
|
In the Set code for your Property, check the status of the DesignMode property of your control. It'll return True of False depending on if your code is running under the forms designer or not.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi!
I have a string something like.
"#Title#CodeProject.#Description#The title name is CodeProject.#Summary#This is summary"
Which is stored in sql server and is rendered in powerpoint slides using automation using interop library. My problem here is I have to make any strings BOLD thats in between # and #.
Could someone please help
|
|
|
|
|
Does the automation library support RTF?
|
|
|
|
|
I dont know. coz i am hardcoding those strings with that are between "#" while inserting into sql table so that i could read anything that goes between # and make it bold.
please help
|
|
|
|
|
How are you moving the text into Powerpoint? What method calls are you using? Because it will be somewhere close to here that you will probably select the text between hashes, using the positions of the hashes in the original text, and set the bold attribute of the font for that text.
Example (pseudo code, you'll have to read up on how to really do this in Powerpoint VBA):
Dim oldText as string
Dim newText as String
Dim start as Integer, end as Integer
oldText = "I want #this# word bold"
start = Pos("#", oldText) ' Get pos of first #
end = Pos("#", oldtext, start) ' Get pos of first # after start pos.
newText = Strip(oldText, "#") ' Removed # from text
PPSlide.Insert(newText)
PPSlide.Select(newText, start, end)
PPSLide.Selection.Fond.Bold = true
"A little learning is a dangerous thing; drink deep, or taste not the Pierian spring: there shallow draughts intoxicate the brain, and drinking largely sobers us again.", by Alexander Pope
My Blog
|
|
|
|
|
Hi!
I am using vb.net and sql server 2005 as an winform environment and i am using Microsoft.Office.Interop.Powerpoint to render the data that i get from sql to powerpoint.
In a powerpoint textbox i have texts just like an in crystal reports( e.g. @value) as
:value and the code to render data
---
If Len(Trim(dr.Item(Strings.Right(Trim(ppItem.TextFrame.TextRange.Text), _
Len(Trim(ppItem.TextFrame.TextRange.Text)) - 1)))) > 0 Then
Dim s As String = dr.Item(Strings.Right(Trim(ppItem.TextFrame.TextRange.Text), Len(Trim(ppItem.TextFrame.TextRange.Text)) - 1))
s = s.Trim
ppItem.TextFrame.TextRange.Text = s-
----
Earlier, the bold text was hardcoded in ppt template slide. this created a layout problem e.g. overlapping text in a slide. now i just have one ":value" instead of multiples where i am concatenating every columns that i get from database. its working fine so far just except from making the text bold that are in "#"
sql code looks like
select '#Marketing & Publicity Points#'+char(13)+char(10)+cast(marketingpoints as varchar(5000)
----
please help
|
|
|
|
|
I got this far
'get position of first occurance say 7
starts = oldText.IndexOf("#")
'get position of second occurance say 12
ends = oldText.IndexOf("#", starts + 1)
newText = Replace(oldText, "#", "")
but I dont know how could i loop it through can some one help
|
|
|
|
|
hi there,
i have a problem in conversion string to single, two textboxes have some alphabets and numerical values too
i want to comparision between them so i coded but its giving error
The error is: Input string was not in a correct format.<br />
Dim z, z1 As Single
z = Convert.ToSingle(zc.Text)
z1 = Convert.ToSingle(zc1.Text)
If z > z1 Then
MsgBox("It can not greater than other z")
zc.Text = ""
ElseIf z < z1 Then
MsgBox("It can not less than other z")
zc1.Text = ""
End If
someone know the solution
|
|
|
|
|
wow - that's some real world code if I ever saw it.
use Single.TryParse. Why is your data of type Single ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
mmm... some numerical values and alphabets , they can be in points
i just need numbers
|
|
|
|
|
OK, so you're saying that your problem is that you need to sanitize your data first ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|