|
Please don't use text speak - it makes you sound stupid and is rude in polite conversation.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Sorry about that
What i said is :
"Thanks for your reply. Must say I didn't think about the list. It's a good idea but one problem still remains. When I'll be creating the html, how to detect exactly where the user placed the picture??
|
|
|
|
|
Or like Ali G is in tha house. Good for comedy but not for anything else.
|
|
|
|
|
Dhanish Balloo wrote: wen i'll b creating the html, how to knw exactly where the user placed the picture? You don't know that now either, do you?
You could ask it's position by looking where the cursor is at that moment. There's a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.selectionstart.aspx">SelectionStart</a>[<a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.selectionstart.aspx" target="_blank" title="New Window">^</a>] property on the textbox that tells you where the cursor is located. I'd go for the easy way, and insert a "tag" at that location - some kind of word that's literally visible in the text and that hints that picture number X should go there. If you don't want such a visual marker you'd need to muck around with a RichTextBox, like shown here[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hmmm.....that seems pretty interesting
I'll give it a try...thanks
|
|
|
|
|
You're welcome
|
|
|
|
|
I am a beginner in visual basic 6 and i need help in creating an application. I am trying to create an application in visual basic 6 which would display the meaning of a word(from the site Dictionary.com) entered in the text box on clicking on the "Search" button. It is actually a web browser which opens the page which contains the meaning of the desired word. Can anyone give me the code for the "Search" button such that after typing in the desired word in the text box and clicking on the "Search" button it would open the Dictionary.com page containing the meaning of that word. I have tried numerous methods but every time it is displaying some error or the other in loading the page.
The code which I used for the search button:
Private Sub Command1_Click()
WebBrowser1.Navigate ("http://dictionary.reference.com/browse" & Text1.Text)
End Sub
Or is there anything else that I can do to remove the error?
|
|
|
|
|
Don't you need a slash after "browse" in the url?
|
|
|
|
|
I had the "/" entered after the browse as well but still error is displayed.
|
|
|
|
|
Bitan Galactico Basak wrote: I am a beginner in visual basic 6
I'll stop you there.
VB6 is a dead technology. It was released in 1998, when the Internet was something that only nerds had access to. Support from Microsoft ended in 2008.
There will never be an update to VB6. None of the outstanding bugs will ever be fixed. New technologies will forever remain beyond its grasp.
Don't start by learning a dead technology. Get yourself a copy of Visual Studio 2013 Express[^], and start learning VB.NET[^] instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Recent weeks, I found bunch of them(VB6 beginners) in Q/A section. Sad thing is one guy came with DAO code(Data control).
thatrajaNobody remains a virgin, Life screws everyone
|
|
|
|
|
but every time it is displaying some error or the other in loading the page
This is not very descriptive. Do you mean the "Internet Explorer Script Error" dialog opens up, but the page is still loaded? Or something else. We can not see your screen.
If this is the case, try the method described here: http://support.microsoft.com/kb/279535[^]
|
|
|
|
|
Hello,
I have a VB.net app that needs to call functions from within a DLL. The DLL was written in C++ (MFC non-managed code). Can someone provide som sample VB.net code or point me to an article that has sample code on how to call functions in this type of DLL?
Any help will be greatly appreciated.
Thanks,
Gary
|
|
|
|
|
|
Thanks! That helped a lot.
Gary
|
|
|
|
|
Your welcome
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Dear Freind,
So many times i posted my questions in this forum , but never i got a satiesfied answer, don't know why?
again following i m posting the query which is raised at the time of executing the program.
Private Sub txtplno_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtplno.LostFocus
Dim str As String
Dim com As SqlCommand
Dim conn As New SqlConnection("Data Source=toshiba-pc;Initial Catalog=VRINDAVAN;User ID=sa;password=zion123")
conn.Open()
str = ("select count(*)from plotmaster where plotno='" + txtplno.Text & "'")
com = New SqlCommand(str, conn)
Dim count As Integer = Convert.ToInt32(com.ExecuteScalar())'**----the error comes here**
conn.Close()
If count > 0 Then
MessageBox.Show("Plot No. already Exist")
txtplno.Text = ""
txtplno.Focus()
Else
txtpsize.Focus()
dgvstatus2.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2
conn.Close()
End If
End Sub
this code is working properly that it's checks the existing record and if exist it throw message that data already exist,and not the cursor goes to next text field after filling the all text boxes just i click on add button it's shows that successfully saved, but when i click on gridview it's display the message at where i indicating above followed by asterisk,and the error is in subject line.
please do needful
below is my table structure
CREATE TABLE [dbo].[plotmaster](
[pkid] [int] IDENTITY(1,1) NOT NULL,
[plotno] [numeric](5, 0) NULL,
[plotsize] [varchar](10) NULL,
[block] [varchar](5) NULL,
[sqyards] [numeric](10, 0) NULL,
[rate] [numeric](18, 0) NULL,
[plot_total_rate] [numeric](18, 0) NULL,
[Book_amt] [numeric](18, 0) NULL,
[date] [smalldatetime] NULL,
[referance] [varchar](50) NULL,
[status] [varchar](15) NULL,
CONSTRAINT [PK_plotmaster_1] PRIMARY KEY CLUSTERED
|
|
|
|
|
Member 10192835 wrote: So many times i posted my questions in this forum , but never i got a satiesfied answer, don't know why?
This appears to be your third forum post. The other two posts have several answers, and you haven't responded to any of them. If you don't reply to an answer, then how is anyone supposed to know whether the answer has worked?
Your posts generally show very little effort, as they include large code dumps with no formatting. They also include phrases such as "do needful" and "send me the solution urgently". Nobody here is paid to answer your questions, and demanding immediate answers from volunteers is a good way to make sure your question is ignored.
Member 10192835 wrote: Dim conn As New SqlConnection("Data Source=toshiba-pc;Initial Catalog=VRINDAVAN;User ID=sa;password=...
Not a good idea to post your sa password in a public forum! I suggest you change it immediately.
It's also not a good idea for your application to connect to the database as a system administrator. Either use integrated authentication, or create a specific user with the minimum permissions necessary for your application to run.
Hard-coding the connection string throughout your code is also a bad idea. You should store the connection string in the configuration file:
How to get Connection String from App.Config in C#[^]
Member 10192835 wrote: str = ("select count(*)from plotmaster where plotno='" + txtplno.Text & "'")
Your application is wide open to SQL Injection[^]. If the user types ';delete plotmaster-- and tabs away from the textbox, your entire table will be deleted.
Even worse, since you're connecting as sa , the user can gain complete control of your database server.
ADO.NET makes it extremely easy to use a parameterised query[^], so there's no excuse for not doing so.
The plotno column is defined as numeric(5, 0) (essentially a restricted int ), but you're trying to compare it to a string. SQL will try to convert the string to a number; if it fails, you'll get the error you're seeing. You need to validate that the text is actually a number before you try to execute your query.
Private Sub txtplno_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtplno.LostFocus
Dim plotno As Integer
If Not Integer.TryParse(txtplno.Text, plotno) Then
Return
End If
Using conn As New SqlConnection("...")
Using com As New SqlCommand("SELECT COUNT(*) FROM plotmaster WHERE plotno = @plotno", conn)
com.Parameters.AddWithValue("@plotno", plotno)
conn.Open();
Dim count As Integer = Convert.ToInt32(com.ExecuteScalar())
If count > 0 Then
MessageBox.Show("Plot No. already Exist")
txtplno.Text = ""
txtplno.Focus()
Else
txtpsize.Focus()
dgvstatus2.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2
End If
End Using
End Using
End Sub
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello
I will take care further and i just want to do best,
|
|
|
|
|
Member 10192835 wrote: So many times i posted my questions in this forum , but never i got a satiesfied answer, don't know why? Firstly, you have not indented your code, or put the correct formatting around it. You should use <pre> tags, automatically generated by the code button, above the edit box, so it looks like:
Private Sub txtplno_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtplno.LostFocus
Dim str As String
Dim com As SqlCommand
Dim conn As New SqlConnection("Data Source=toshiba-pc;Initial Catalog=VRINDAVAN;User ID=sa;password=zion123")
conn.Open()
str = ("select count(*)from plotmaster where plotno='" + txtplno.Text & "'")
com = New SqlCommand(str, conn)
Dim count As Integer = Convert.ToInt32(com.ExecuteScalar())
conn.Close()
If count > 0 Then
MessageBox.Show("Plot No. already Exist")
txtplno.Text = ""
txtplno.Focus()
Else
txtpsize.Focus()
dgvstatus2.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2
conn.Close()
End If
End Sub
Secondly, a quick look at the documentation[^], would probably give a clue as to what you are doing wrong.
Veni, vidi, abiit domum
|
|
|
|
|
|
is it possible to have a duplicate uuid generated in vb.net?
MsgBox(Guid.NewGuid().ToString)
What???
|
|
|
|
|
In theory, yes. In practice, no.
Why?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
A Guid is 128 bit. Therefore you would have to generate 2^128 + 1 GUIDs to encounter a single GUID twice.
A thread on StackOverflow.com[^] says that you would need about 10790283070806014188970 years to encounter a single GUID twice, assuming your program does nothing else than creating GUIDs and runs at a processor speed of 1 GhZ, without any interruption by CPU power eaten by other programs or the operating system itself.
As you probably can think now, encountering the same GUID twice would be very bad luck and can safely considered as being unrealistic.
People becoming wiser in order to notice the stupid things they did back in the young days. This doesn't mean that they really stop doing those things. Wise people still do stupid things, only on purpose.
|
|
|
|
|
Marco Bertschi wrote: Therefore you would have to generate 2^128 + 1 GUIDs to encounter a single GUID twice.
Not quite. GUIDs aren't entirely random, so you'd only need 2122 to get a collision with a specific GUID. To get a collision anywhere within the set of generated GUIDs, you'd only need to generate around 261 GUIDs.
Eric Lippert goes into more detail in part 3 of his GUID guide series[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|