|
I am working witn VB2003.net on a windows app. I have an on enter trigger of my text box on form1 that opens form2.
I am looking to get the data string entered into the text box on form2 back into the text field in form1 after form 2 is closed.
Does anyone have any ideas
|
|
|
|
|
Private Sub TextBoxOnForm1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBoxOnForm1.Enter
Dim frm As New Form2
With frm
.ShowDialog()
Me.TextBoxOnForm1.Text = .TextBoxOnForm2.Text
End With
End Sub
|
|
|
|
|
I'm not familiar with VB.net, only VB 6.0, but can't you just put the following pseudocode in the "close" or "terminate" function of form 2? :
(in form 2 terminate function):
buffer = textBox1.caption
form1.textBox1.caption = buffer
Good luck!
|
|
|
|
|
Hi there.
I am playing with BLL and have hit a stumbleing block.
I am useing VS express 2005.
The DLL I have returns a DataTable.
Using the objectdatasource in asp.net 2.0 i connect to this DLL to get the select method that returns the datatable.
That works fine, when i run the asp page the gridview displays perfectly.
But In the editor it will not display the table schema, so I cannot see column headings etc.
In vb 2005 is there somthing i need to add to the class to return the schema? The code is
<code>CODE
Private Sub dbConn()
If Not conn Is Nothing Then conn.Close()
Dim connStr As String
connStr = "Server=localhost;Database=dls;Uid=blag;Pwd=blahblah;"
conn = New MySqlConnection(connStr)
End Sub
Public Function selectAllMessages() As DataTable
dbConn()
Dim da As MySqlDataAdapter
Dim Data = New DataTable("messages")
da = New MySqlDataAdapter("SELECT * FROM tbl_messages", conn)
conn.Open()
da.Fill(Data)
Return Data
End Function
</code>
Andrzej
|
|
|
|
|
how can we use sql DTS tool in vb.net?do we require sql server servicepack 2 for it?
|
|
|
|
|
please anybody put the source code for uploading the file from remote host to our server in vb.net Thank you.
|
|
|
|
|
might be a start href="http://www.developer.com/net/vb/article.php/10926_3424121_2
nothing change just rearrange
|
|
|
|
|
Hi ,
i have a typed dataset to count on it in using the crystal report .
this dataset contains two tables "Reserver" & "Reservation" i have done a relashion between the two .
i have wrote the code necessary but what i need now is how can i display this ??
Name of reserver : reserver.name_reser
telephone of reserver : tel_reser
...
and right here i wanna display all the reservation of this reserver like this :
num_resv date_resv hr_resv .... .... .... ....
. . . . . . .
. . . . . . .
. . . . . . .
i hope you understood me
thanks foe helping
ahh i forgot !! i will recuperate the num-reser from a text box in a form named frmresv wich contains the print bottun
& i have a num_reser fielsd in the reservation table
try to be good if you can't be the best
|
|
|
|
|
Hi,
I hope that you need to show the report in the master/detail report format.
Create the main report , which will display the master item like name of the reserver and the telephone number of the reserver,
In the detail band of the report you . Insert/Create the subreport and while doing that you link the two reports by the common field.
this can be done by clicking on the Link tab in the sub report properties.
Hope this will help you alot
Happy programming
|
|
|
|
|
thnx man i will try it
try to be good if you can't be the best
|
|
|
|
|
Does anyone know how to get a list of MSDE servers on a local network? Any help would be MUCH apreciated as I'm a little lost on this subject thanks in advance!
Pablo
|
|
|
|
|
Imports System<br />
Imports System.Text<br />
Imports System.Windows.Forms<br />
Imports System.Runtime.InteropServices<br />
<br />
Public Class SQLLocator<br />
<br />
<DllImport("odbc32.dll")> Private Shared Function SQLAllocHandle(ByVal hType As Short, ByVal inputHandle As IntPtr, ByRef outputHandle As IntPtr) As Short<br />
End Function<br />
<br />
<DllImport("odbc32.dll")> Private Shared Function SQLSetEnvAttr(ByVal henv As IntPtr, ByVal attribute As Integer, ByVal valuePtr As IntPtr, ByVal strLength As Integer) As Short<br />
End Function<br />
<br />
<DllImport("odbc32.dll")> Private Shared Function SQLFreeHandle(ByVal hType As Short, ByVal handle As IntPtr) As Short<br />
End Function<br />
<br />
<DllImport("odbc32.dll")> Shared Function SQLBrowseConnect(ByVal hconn As IntPtr, ByVal inString As StringBuilder, ByVal inStringLength As Short, ByVal outString As StringBuilder, ByVal outStringLength As Short, ByRef outLengthNeeded As Short) As Short<br />
End Function<br />
<br />
Private Shared SQL_HANDLE_ENV As Short = 1<br />
Private Shared SQL_HANDLE_DBC As Short = 2<br />
Private Shared SQL_ATTR_ODBC_VERSION As Integer = 200<br />
Private Shared SQL_OV_ODBC3 As Integer = 3<br />
Private Shared SQL_SUCCESS As Short = 0<br />
Private Shared SQL_NEED_DATA As Short = 99<br />
Private Shared DEFAULT_RESULT_SIZE As Short = 1024<br />
Private Shared SQL_DRIVER_STR As String = "DRIVER=SQL SERVER"<br />
<br />
Public Shared Function GetServers() As String()<br />
Dim retVal As String() = Nothing<br />
Dim txt As String = String.Empty<br />
Dim henv As IntPtr = IntPtr.Zero<br />
Dim hconn As IntPtr = IntPtr.Zero<br />
Dim inString As New StringBuilder(SQL_DRIVER_STR)<br />
Dim outString As New StringBuilder(DEFAULT_RESULT_SIZE)<br />
Dim inStringLength As Short = CShort(inString.Length)<br />
Dim lenNeeded As Short = 0<br />
<br />
Try<br />
If SQL_SUCCESS = SQLAllocHandle(SQL_HANDLE_ENV, henv, henv) Then<br />
If SQL_SUCCESS = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, New IntPtr(SQL_OV_ODBC3), 0) Then<br />
If SQL_SUCCESS = SQLAllocHandle(SQL_HANDLE_DBC, henv, hconn) Then<br />
If SQL_NEED_DATA = SQLBrowseConnect(hconn, inString, inStringLength, outString, DEFAULT_RESULT_SIZE, lenNeeded) Then<br />
If DEFAULT_RESULT_SIZE < lenNeeded Then<br />
outString.Capacity = lenNeeded<br />
If SQL_NEED_DATA <> SQLBrowseConnect(hconn, inString, inStringLength, outString, lenNeeded, lenNeeded) Then<br />
Throw New ApplicationException("Unabled to aquire SQL Servers from ODBC driver.")<br />
End If<br />
End If<br />
txt = outString.ToString()<br />
Dim start As Integer = txt.IndexOf("{") + 1<br />
Dim len As Integer = txt.IndexOf("}") - start<br />
If start > 0 And len > 0 Then<br />
txt = txt.Substring(start, len)<br />
Else<br />
txt = String.Empty<br />
End If<br />
End If<br />
End If<br />
End If<br />
End If<br />
Catch ex As Exception<br />
txt = String.Empty<br />
Finally<br />
If Not hconn.Equals(IntPtr.Zero) Then<br />
SQLFreeHandle(SQL_HANDLE_DBC, hconn)<br />
End If<br />
If Not henv.Equals(IntPtr.Zero) Then<br />
SQLFreeHandle(SQL_HANDLE_ENV, hconn)<br />
End If<br />
End Try<br />
If txt.Length > 0 Then<br />
retVal = txt.Split(",".ToCharArray())<br />
End If<br />
Array.Sort(retVal)<br />
Return retVal<br />
End Function<br />
<br />
Public Shared Function GetCatalogs(ByVal SQLServer As String, ByVal userName As String, ByVal password As String) As String()<br />
Dim retVal As String() = Nothing<br />
Dim txt As String = String.Empty<br />
Dim henv As IntPtr = IntPtr.Zero<br />
Dim hconn As IntPtr = IntPtr.Zero<br />
Dim cnString As New StringBuilder(SQL_DRIVER_STR)<br />
Dim inString As New StringBuilder("SERVER=" + SQLServer + ";UID=" + userName + ";PWD=" + password + ";")<br />
Dim outString As New StringBuilder(DEFAULT_RESULT_SIZE)<br />
Dim cnStringLength As Short = CShort(cnString.Length)<br />
Dim inStringLength As Short = CShort(inString.Length)<br />
Dim lenNeeded As Short = 0<br />
<br />
Try<br />
If SQL_SUCCESS = SQLAllocHandle(SQL_HANDLE_ENV, henv, henv) Then<br />
If SQL_SUCCESS = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, New IntPtr(SQL_OV_ODBC3), 0) Then<br />
If SQL_SUCCESS = SQLAllocHandle(SQL_HANDLE_DBC, henv, hconn) Then<br />
If SQL_NEED_DATA = SQLBrowseConnect(hconn, cnString, cnStringLength, outString, DEFAULT_RESULT_SIZE, lenNeeded) Then<br />
If SQL_NEED_DATA = SQLBrowseConnect(hconn, inString, inStringLength, outString, DEFAULT_RESULT_SIZE, lenNeeded) Then<br />
If DEFAULT_RESULT_SIZE < lenNeeded Then<br />
outString.Capacity = lenNeeded<br />
If SQL_NEED_DATA <> SQLBrowseConnect(hconn, inString, inStringLength, outString, lenNeeded, lenNeeded) Then<br />
Throw New ApplicationException("Unabled to aquire SQL Catalogs from ODBC driver.")<br />
End If<br />
End If<br />
txt = outString.ToString()<br />
Dim start As Integer = txt.IndexOf("{") + 1<br />
Dim len As Integer = txt.IndexOf("}") - start<br />
If start > 0 And len > 0 Then<br />
txt = txt.Substring(start, len)<br />
Else<br />
txt = String.Empty<br />
End If<br />
End If<br />
End If<br />
End If<br />
End If<br />
End If<br />
Catch ex As Exception<br />
'Throw away any error if we are not in debug mode<br />
txt = String.Empty<br />
Finally<br />
If Not hconn.Equals(IntPtr.Zero) Then<br />
SQLFreeHandle(SQL_HANDLE_DBC, hconn)<br />
End If<br />
If Not henv.Equals(IntPtr.Zero) Then<br />
SQLFreeHandle(SQL_HANDLE_ENV, hconn)<br />
End If<br />
End Try<br />
If txt.Length > 0 Then<br />
retVal = txt.Split(",".ToCharArray())<br />
End If<br />
Return retVal<br />
End Function<br />
End Class
Jim
|
|
|
|
|
Thanks . I just found this a little while ago LOL
Pablo
|
|
|
|
|
hai i m working in vb.net
my problem is that when first time my application run,it shd generate a string.
and after that every time it should generate the same string.
actually i have a .lic file,which provide licensing in vb.net.
when first time application run it should generate the string,i will find that key by debugging.
and save it in .lic file.so that next time it will authenticate me.
i just dont want to hardcode because of hacking.
plz suggest any solution
|
|
|
|
|
I tried to create textbox at run time depending on the value input by the user. I used a for loop to effect the creation but when I run the code only the one textbox is displayed.Please how do I ensure that all textboxes are displayed and the form expands proportionally.
The code is here below:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As Integer, b As Integer
If (IsNumeric(txtdata_num.Text)) Then
x = CInt(txtdata_num.Text)
Dim st As New System.Windows.Forms.TextBox()
For b = 0 To x - 1
st.Location = y
st.Name = "textboxA"
st.Size = New System.Drawing.Size(40, 10)
st.Visible = True
Me.Controls.Add(st)
y = New System.Drawing.Point(st.Location.X + st.Size.Width + 10, st.Location.Y + st.Size.Height + 10)
MsgBox("my name is " & st.Name)
MsgBox("my locattion" & st.Location.Y & st.Location.X)
MsgBox("my width" & st.Size.Width & st.Size.Height)
Next
End If
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
Dim x As New TextBox
x.Location = New Point(20, 350)
x.Size = New Size(100, 20)
x.Name = "a"
Me.Controls.Add(x)
Dim y As New TextBox
y.Location = New Point(120, 350)
y.Size = New Size(100, 20)
y.Name = "a"
Me.Controls.Add(y)
its worked whatever the name is , the two testboxes have the same name
Tamimi - Code
|
|
|
|
|
try moving this line:
Dim st As New System.Windows.Forms.TextBox()
into the for loop
|
|
|
|
|
Thanks i moved the line into the loop and it worked.
Now any number of textboxes i want can be displayed at run-time.
Zacharyshroyer i am glad for the heplp
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
Hi all,
i have a web application developed in vb.net 2005.... now i want the clients on LAN to use it....i'm unable to do so please tell me how do i do that.
Thanks and Regards..
|
|
|
|
|
when you run you web aaplicationthern address will look like this http://localhost/ApplicationName/login.aspx so let the client replace
the localhost with your ip address like this
http://ip address/ApplicationName/login.aspx
Tamimi - Code
|
|
|
|
|
Hi Tamimi,
Thanx for your help....but sorry it did not work instead it gives some error...the error is....
Source Error:
Line 11: debugging ASP.NET files.
Line 12: -->
Line 13: <compilation defaultLanguage="vb" debug="true"><assemblies><add assembly="CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportSource, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Shared, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Web, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation>
Line 14:
Line 15: <!-- CUSTOM ERROR MESSAGES
Please Help..
Thanks and Regards
|
|
|
|
|
i don't know its work for me with VS 2003
sorry !!
Tamimi - Code
|
|
|
|
|
Hi
i know that it works on VB.Net 2003....it has also worked for me in past....but its not working in VB.Net 2005....i dunno wat to do.....can anybody else help....
Thanks and Regards.
|
|
|
|
|
Go back to basics and RTFM re: Crystal, ASP.NET, VB.NET and web design.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Thanks for your Help steve.
But the way it used to work in Vb.Net 2003 its not doin in VB.Net 2005...so i asked...
Thanks and Regards.
|
|
|
|
|