By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,155 Members | 1,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,155 IT Pros & Developers. It's quick & easy.

select textbox.text

P: n/a
I have this code, I need see in textbox.text all my information, how I do that

Function Consultas(ByVal usuario As String) As System.Data.DataSet
Dim connectionString As String = "server='Sistemas'; user id='sa';
password=''; database='Sistemas'"
Dim dbConnection As System.Data.IDbConnection = New
System.Data.SqlClient.SqlConnection(connectionStri ng)

Dim queryString As String = "SELECT [ImvenrtarioCompusSQL].* FROM
[ImvenrtarioCompusSQL] WHERE ([ImvenrtarioCo"& _
"mpusSQL].[Usuario] = @Usuario)"
Dim dbCommand As System.Data.IDbCommand = New
System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection

Dim dbParam_usuario As System.Data.IDataParameter = New
System.Data.SqlClient.SqlParameter
dbParam_usuario.ParameterName = "@Usuario"
dbParam_usuario.Value = usuario
dbParam_usuario.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_usuario)

Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return dataSet

Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
So access dataSet.Tables[0] and iterate over the Rows property and get the
data you need/want. Once you have that data, you can put it into a TextBox.
I'm not sure exactly what you want, but here's a sample that might help:

foreach (DataRow row in dataSet.Tables[0])
{
string val = (string)row["MyStringColumn"];
MyTextBox.Text += val + Environment.NewLine; // append this in my multiline
TextBox
}

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have this code, I need see in textbox.text all my information, how I
do that

Function Consultas(ByVal usuario As String) As System.Data.DataSet
Dim connectionString As String = "server='Sistemas'; user
id='sa';
password=''; database='Sistemas'"
Dim dbConnection As System.Data.IDbConnection = New
System.Data.SqlClient.SqlConnection(connectionStri ng)
Dim queryString As String = "SELECT [ImvenrtarioCompusSQL].*
FROM
[ImvenrtarioCompusSQL] WHERE ([ImvenrtarioCo"& _
"mpusSQL].[Usuario] = @Usuario)"
Dim dbCommand As System.Data.IDbCommand = New
System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_usuario As System.Data.IDataParameter = New
System.Data.SqlClient.SqlParameter
dbParam_usuario.ParameterName = "@Usuario"
dbParam_usuario.Value = usuario
dbParam_usuario.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_usuario)
Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return dataSet


Nov 19 '05 #2

P: n/a
I nedd to put in textbox1.text=usuario. textbox2.text=ip etc. using the code
below, thank for you answer.

"Brock Allen" wrote:
So access dataSet.Tables[0] and iterate over the Rows property and get the
data you need/want. Once you have that data, you can put it into a TextBox.
I'm not sure exactly what you want, but here's a sample that might help:

foreach (DataRow row in dataSet.Tables[0])
{
string val = (string)row["MyStringColumn"];
MyTextBox.Text += val + Environment.NewLine; // append this in my multiline
TextBox
}

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have this code, I need see in textbox.text all my information, how I
do that

Function Consultas(ByVal usuario As String) As System.Data.DataSet
Dim connectionString As String = "server='Sistemas'; user
id='sa';
password=''; database='Sistemas'"
Dim dbConnection As System.Data.IDbConnection = New
System.Data.SqlClient.SqlConnection(connectionStri ng)
Dim queryString As String = "SELECT [ImvenrtarioCompusSQL].*
FROM
[ImvenrtarioCompusSQL] WHERE ([ImvenrtarioCo"& _
"mpusSQL].[Usuario] = @Usuario)"
Dim dbCommand As System.Data.IDbCommand = New
System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_usuario As System.Data.IDataParameter = New
System.Data.SqlClient.SqlParameter
dbParam_usuario.ParameterName = "@Usuario"
dbParam_usuario.Value = usuario
dbParam_usuario.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_usuario)
Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return dataSet


Nov 19 '05 #3

P: n/a
I ned to put textbox1.text=usuario, textbox2,text=ip, etc. thank for you
answer.

"Brock Allen" wrote:
So access dataSet.Tables[0] and iterate over the Rows property and get the
data you need/want. Once you have that data, you can put it into a TextBox.
I'm not sure exactly what you want, but here's a sample that might help:

foreach (DataRow row in dataSet.Tables[0])
{
string val = (string)row["MyStringColumn"];
MyTextBox.Text += val + Environment.NewLine; // append this in my multiline
TextBox
}

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have this code, I need see in textbox.text all my information, how I
do that

Function Consultas(ByVal usuario As String) As System.Data.DataSet
Dim connectionString As String = "server='Sistemas'; user
id='sa';
password=''; database='Sistemas'"
Dim dbConnection As System.Data.IDbConnection = New
System.Data.SqlClient.SqlConnection(connectionStri ng)
Dim queryString As String = "SELECT [ImvenrtarioCompusSQL].*
FROM
[ImvenrtarioCompusSQL] WHERE ([ImvenrtarioCo"& _
"mpusSQL].[Usuario] = @Usuario)"
Dim dbCommand As System.Data.IDbCommand = New
System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_usuario As System.Data.IDataParameter = New
System.Data.SqlClient.SqlParameter
dbParam_usuario.ParameterName = "@Usuario"
dbParam_usuario.Value = usuario
dbParam_usuario.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_usuario)
Dim dataAdapter As System.Data.IDbDataAdapter = New
System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return dataSet


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.