|
Hi all...
i'm a bit confuse in VB.NET. Actually i want to upload the webform that i've done in VB.NET to internet. So can we do like that in VB.NET?
Can we also create our own address name (www.....) for the webform?
if yes can someone please help me..
Thanks..
areon25
|
|
|
|
|
These are not programming tasks. What you need to do is set up a server that is visible to the web, and also if you want a www.xxx.com address, you need to register it and set it up to point to the IP address of your online machine. Or you can just get a web hosting company to do it for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I wanted to know how to populate a form once you have done a search on a record. What I am trying to do is that when I search for a record in the access database, once it finds the record I want it to go to another form where I have textboxes and it should populate the information in that form. The search is on a different form, so I have to switch between forms. If anybody can guide me on the right track I will appreciate it.
|
|
|
|
|
I don't do alot of database interaction but I think I can help you with the interaction between the two forms. You will need to create a Public object reference from Form2 to Form1. Below is a short VB.NET sample that copies the text from a TextBox1 in Form1 to a TextBox2 in Form2. This sample will assume that you have already created two forms named: Form1 and Form2.
In Form2, insert the following code right below the initial class/inherits declaration:
Public Class Form2
Inherits System.Windows.Forms.Form
'Insert this code
Public myObject as Object
Now save the changes to Form2.
One thing you may or may not know is that when Objects are passed to one another, the receiving object does not get a copy of the the passing object, it gets the memory reference to it! That is great news for us. We will now create code to pass Form1's object reference to Form2.
Go to Form1 and it's code view. I will assume that you are showing Form2 by clicking a button of some sort, therefore I will use the sample name Button1.
Private Sub Button1_Click(..) Handles Button1.Click
'sample form2 declaration
Dim pForm2 as new Form2
' here's where the object reference is passed!
' Me is the command for the current form
pForm2.myObject = Me
pForm2.Show
End Sub
The two forms are now linked based on the object reference. Now to illustrate this, create a textbox in each of the forms. (TextBox1 in Form1 and TextBox2 in Form2) Also, add a button to: FORM2.
Form2 will be sending the text from TextBox2 to TextBox1. In Form2's designer mode double click on the newly created Button1 to open the code view and .net will automatically create the click handler sub. In that click handler, insert the following code:
Private Sub Button1_Click(..) Handles Button1.Click
'Note: This button1 code should be in form2 not form1!
'this the code. "Ctype" is casting an unknown object
'to a known object aka. Form1
CType(myObject, Form1).Textbox1.Text = Textbox2.Text
End Sub
There you go! Now run the program and test the code. Form2's textbox should send text to Form1's textbox. You should be able to go from there. Good Luck!
Richard Blythe
|
|
|
|
|
will this work if I have a search textbox in form2 and when I hit the search button on form2 it should go to the database and pull that record out and display all the information on form1 filling in all the textboxes on form1. Please let me know. Thanks for all your help so far.
|
|
|
|
|
I took a class in database interaction but I my memory on that topic is foggy. Here is some simple code that will search through an employee table for the first name and update form1 accordingly.
This code will assume that you have linked your textboxes in Form1 to the database. It also assumes the you have created the object reference mentioned in the last email. In form2, create the two following items: a button named btnSearch and a textbox named Textbox1. Below is click handler for btnSearch:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
With CType(myObject, Form1)
' create a boolean var
Dim blnFoundMatch As Boolean
'initialize a for loop to search all records (if necessary)
For intX As Integer = 0 To .DsEmployees1.tblEmployees.Count - 1
'See if the current fldFirstName = Textbox1's text
If .DsEmployees1.tblEmployees.Item(intX).fldFirstName = TextBox1.Text Then
blnFoundMatch = True
'update form1 with the contents of row num: intX
.BindingContext(.DsEmployees1, "tblEmployees").Position = intX
Exit For
End If
Next
If blnFoundMatch = False Then
MessageBox.Show("No match was found on " & TextBox1.Text, "No Match",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show(TextBox1.Text & " was found and form1 has been updated.", "MatchFound", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End With
End Sub
Hope this helps you. I'll be leaving on a business trip after tommorrow but feel free to write anytime.
Richard
|
|
|
|
|
I tried your suggestion and for some reason I am not able to get information to the other form. Is there anyway you can write me a small program, so I can have a visual presentation of what you are talking about. I would really appreciate that. Please let me know. Thanks
|
|
|
|
|
The simplest way I have found to communicate between classes (aka forms) is with public PO Boxes in a module. I'm not sure what form you data is taking after being extracted from the database, but, for example, a string object can be passed between forms with a string PO Box. The PO Box may look like this:
Module M_Common
Public strPOBox01 As String
End Module
In the form that extracts the data from the database, place the text needed by the second form in the PO Box thusly:
strPOBox01 = myTextData
In the form that populates the controls, extract the text from the PO Box just as simply:
myTextBox.Text = strPOBox01
You can see more complex examples of this technique in this article where entire records are being exchanged via one PO Box.
George
|
|
|
|
|
I tried your suggestion, but with no luck. I was not able to get the information to the other form. I have a search textbox on form2 and when I hit the search button on form2 it should find that record and bring up form1 where there are textboxes and datetimepicker that should be updated automatically according to the record information and I am unable to do that. Any ideas
|
|
|
|
|
You've posted exactly the same comment and question in response to two very different responses to your original question. Which suggestion did you try? If you tried the other person's idea, I can't help you. If you tried my suggestion, did you first read the article I referenced in my first response? The demo project in that article provides a couple examples of passing entire records back and forth between forms using a technique that has been proven over and over to work.
|
|
|
|
|
well I tried both. yes i read the article, but that article is bringing up the records in a datagrid and then you select a record and then hit change, but what I want is to put a search field for my example it will be barcodeID and then i hit the search button that is when it should go to the other form and bring up the information. hope that helps. thanks
|
|
|
|
|
Let me try one last time. I guess I'm not being very clear. This is what I think should be happening. (This is pretty much identical to what's happening in the demo project in the article you read.)
1. In Form 1, the Search button is clicked.
2. In Form 1, the Search_Click event places the barcode ID into a public PO string variable that's located in a module.
3. In Form 1, the Search_Click event displays Form 2 as a dialog box.
4. In Form 2, the Form_Load event retrieves the barcode ID from the public PO string variable and then uses that barcode ID to retrieve the associated record from the database.
5. In Form 2, the Form_Load event then displays the associated data from the retrieved record.
If you can't make this work, please don't ask me again because I can't get any simpler except to write your program and I'm not willing to do that.
|
|
|
|
|
Alright it makes sense now that you explained it. I will try to take what you said and make the changes and see what happens. I don't want you to write my program, just wanted to know how it worked with my situation, since I could not figure it out. Thanks for all your help.
|
|
|
|
|
Hello,
I have tried the code below to update my table, but I'm not sure if it is in the right context... The problem that I am facing is that my data is being passed to the table, but it creates a new row as oppose to updating the row that I specified... and I think that is coming from the line that reads myLocalDataSet.Tables("tblCall_Reports").Rows.Add()
How can I modify this code so that it will update my table based on the SQL criteria?
<br />
'Save changes to the database<br />
myLocalSqlDataAdapter.SelectCommand.CommandText = "SELECT * FROM tblCall_Reports WHERE UID = " & txtUID.Text<br />
myLocalDataSet.Tables("tblCall_Reports").Rows.Add()<br />
myLocalSqlDataAdapter.Update(myLocalDataSet, "tblCall_Reports")<br />
Thanks in advance,
Rashar
|
|
|
|
|
You can use following command to update table with select statement
Dim sqlString As String = "select * from employee where id=1"
Dim comm As New SqlCommand(sqlString, conn)
Dim adp As New SqlDataAdapter
Dim sb As New SqlCommandBuilder(adp)
adp.SelectCommand = comm
Dim ds As New DataSet
adp.Fill(ds)
row(3) = "Dealer"
adp.Update(ds)
Kumar Prabhakar
|
|
|
|
|
I'm new to screen scrape. can anybody help me on how to screen scrape a web page
|
|
|
|
|
|
FYI:
I'm programming in Visual Basic 6.0
I have an ADODC control that is linked to a .mdb file I created in Microsoft Access
The provider I am using to connect to the database is Microsoft Jet OLE DB 4.0
My Problem:
String comparisons in my SQL queries are not behaving the way I'd like:
As a silly example,
SELECT * FROM tbl WHERE 'a' = 'A' returns everything in tbl
SELECT * FROM tbl WHERE 'a' > 'A' returns nothing in tbl
SELECT * FROM tbl WHERE 'a' < 'A' returns nothing in tbl
How do I make the above comparisons so they are case sensitive?
I need my comparisons to abide by the following character ranking scheme:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoffpro01/html/GettingStartedwithADO.asp
Under this scheme, the following holds:
'a' = 'A' = FALSE
'a' > 'A' = TRUE
'.0000m3d10_1' > '.0000m3d10Z' = TRUE
Your help is greatly appreciated!
-Lee``
-- modified at 16:09 Wednesday 12th July, 2006
|
|
|
|
|
Hello, all!
Once again, I'm new to VB as a whole and have a fairly basic question. What I have is a panel control filled with several link labels. The current size of the panel control (and the size it needs to stay) allows for four link labels to be readily viewable but if there happens to be a fifth link label or more they are added below the bottom of the panel.
I simply need to add a scrollbar to the panel that will allow the user to scroll up and down within the panel. As always, any help is greatly appreciated. Thank you in advance!
|
|
|
|
|
Pretty much, all you need to do is set the Panel's .AutoScroll property to True . Whalla! Instant scrollbar, if the need arises.
You can check out the documentation on this here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Haha.
Wow.
Very simple - something that I have grown to love about VB.NET. I come from a game development background where we used Object-Oriented C++ and no MFC (MFC creates way too much overhead to allow for the processing speed necessary in games these days).
I can see why VB.NET is quickly becoming a standard for app development.
Thank you for the help!
|
|
|
|
|
IP-GATES OFFERS MCSE CCNA BOOT CAMP TRAINING IN INDIA/GOA
MCSE CCNA CCNP MCSD VB.NET RHCE CHECKPOINT CCSE CCSP
COST EFFECTIVE .A STUDY AND HOLIDAY EXPERIENCE
Course fee includes Hotel accomodatin(Beautiful holiday resorts in Goa), Local transport,Dinner cruise and a jungle trip
IP-GATES (IT TRAINING TRUSTED GLOBALLY)
http://www.ipgates.com
|
|
|
|
|
Get your damn ad out of here! SPAMMER!
If your too cheap to BUY advertising space on CodeProject, how is anynone to take you seriously?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Is it possible to execute the sql server 2005 Jobs from vb.net 2005?
If Yes than can you tell me how it's possible?any link or any snappet code or
any articles by which it describe who idea then it will be good for me.
Any alternative way to do that is also acceptable?
Basic requirement is to call / execute sql server 2005 Job from vb.net 2005
thanks in adv.
montu3377
|
|
|
|
|
It's done the exact same way you execute any SQL statement from VB.NET, like SELECT, UPDATE, INSERT, ... The question comes down to what's the SQL statement you need to execute to launch your job? It'll be exactly the same as if you executed it from the SQL Server console.
SqlCommand[^] class docs
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 12:56 Wednesday 12th July, 2006
|
|
|
|