Your problem is the statement:
"SELECT * FROM table1 WHERE username=textbox1.text"
In this case, textbox1.text is a control property so it should not be included within the SQL. This should be replaced with a parameter (i.e.' @userName'), and you can then add the parameter value to the datasource command, i.e.
SglDataSource2.SelectParameters.Add("@userName", textbox1.Text)
So , in other words, 'username' is the field name in the database- this is a constant, '@userName' is a parameter which acts as a placeholder for the parameter value which you pass to the command, which in your case is the Text property of textbox1.