Click here to Skip to main content
15,888,521 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert VB to C# Pin
Pavlex41-Dec-16 4:59
Pavlex41-Dec-16 4:59 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen1-Dec-16 5:03
professionalEddy Vluggen1-Dec-16 5:03 
GeneralRe: Convert VB to C# Pin
Pavlex41-Dec-16 5:05
Pavlex41-Dec-16 5:05 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen1-Dec-16 5:10
professionalEddy Vluggen1-Dec-16 5:10 
GeneralRe: Convert VB to C# Pin
Pavlex41-Dec-16 5:17
Pavlex41-Dec-16 5:17 
GeneralRe: Convert VB to C# Pin
Pavlex41-Dec-16 6:10
Pavlex41-Dec-16 6:10 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen1-Dec-16 8:24
professionalEddy Vluggen1-Dec-16 8:24 
GeneralRe: Convert VB to C# Pin
Pavlex46-Dec-16 22:30
Pavlex46-Dec-16 22:30 
When I run program with this commands it prints System.Data.SqlClient.SqlCommand!!!Why it won't show random word from database???
C#
string cs= @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename= C:\Users\Pavle\Documents\Visual Studio 2015\Projects\Test slagalica\Test slagalica\Slagalica-DB.mdf;Integrated Security=True";
            string queryString = "SELECT * FROM table1 WHERE LEN(Reci) >=10 AND LEN(Reci) <=12 ";
            using (SqlConnection connection = new SqlConnection(cs))
            {
                SqlCommand mycommand = new SqlCommand(queryString, connection);
                try
                {
                    connection.Open();
                    SqlDataReader reader = mycommand.ExecuteReader();
                    label14.Text = Convert.ToString(mycommand);
                    reader.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                } 
            }

GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 0:29
professionalEddy Vluggen7-Dec-16 0:29 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 0:49
Pavlex47-Dec-16 0:49 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 1:04
professionalEddy Vluggen7-Dec-16 1:04 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 1:07
Pavlex47-Dec-16 1:07 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 1:12
professionalEddy Vluggen7-Dec-16 1:12 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 1:14
Pavlex47-Dec-16 1:14 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 2:49
professionalEddy Vluggen7-Dec-16 2:49 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 8:51
Pavlex47-Dec-16 8:51 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 9:31
professionalEddy Vluggen7-Dec-16 9:31 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 10:29
Pavlex47-Dec-16 10:29 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 11:43
Pavlex47-Dec-16 11:43 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 21:31
Pavlex47-Dec-16 21:31 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen8-Dec-16 3:02
professionalEddy Vluggen8-Dec-16 3:02 
GeneralRe: Convert VB to C# Pin
Pavlex48-Dec-16 7:55
Pavlex48-Dec-16 7:55 
GeneralRe: Convert VB to C# Pin
Pavlex48-Dec-16 12:27
Pavlex48-Dec-16 12:27 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen9-Dec-16 2:59
professionalEddy Vluggen9-Dec-16 2:59 
GeneralRe: Convert VB to C# Pin
Pavlex49-Dec-16 7:28
Pavlex49-Dec-16 7:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.