Click here to Skip to main content
15,887,027 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionQuestion regarding performance and string comparisons Pin
Jon_Boy12-Mar-09 5:00
Jon_Boy12-Mar-09 5:00 
AnswerRe: Question regarding performance and string comparisons Pin
Dave Kreskowiak12-Mar-09 7:13
mveDave Kreskowiak12-Mar-09 7:13 
GeneralRe: Question regarding performance and string comparisons Pin
Jon_Boy12-Mar-09 8:22
Jon_Boy12-Mar-09 8:22 
GeneralRe: Question regarding performance and string comparisons Pin
Jon_Boy13-Mar-09 3:36
Jon_Boy13-Mar-09 3:36 
QuestionHow to use spell checker in vb.net Pin
dilipmca0412-Mar-09 2:38
dilipmca0412-Mar-09 2:38 
AnswerRe: How to use spell checker in vb.net Pin
Eddy Vluggen12-Mar-09 4:29
professionalEddy Vluggen12-Mar-09 4:29 
AnswerRe: How to use spell checker in vb.net Pin
Dave Kreskowiak12-Mar-09 7:23
mveDave Kreskowiak12-Mar-09 7:23 
QuestionGridview SqlDataSource SelectCommand Pin
Tomb42112-Mar-09 2:19
Tomb42112-Mar-09 2:19 
In Visual Studio 2005 .Net, How can you programmatically edit the string value for a Gridview SqlDataSource SelectCommand?

For example, I need to conditionally replace SelectCommand="Select * from [Table1]" with SelectCommand="Select * from [Table2]"

Code snippet Example:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
&nbsp;<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns&>
<asp:TemplateField HeaderText="Office Number" SortExpression="O Number">

.... etc..

<asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status">
<HeaderStyle BackColor="#EBFFEB" />
</asp:BoundField>

.... etc..

</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=(serverName);Initial Catalog=(databaseName);Integrated Security=True" SelectCommand="Select * from [Table1]"</asp:SqlDataSource>

-
I have tried various AsP <%#variable%> techniques without success.
-
I have also tried the following (in the Page_Load and a Button1_Click sub) :
Dim SqlDatasource1 As New SqlDataSource
Dim GridView1 As New GridView

Dim sSQLDataSource As String
sSQLDataSource = "Select * from [Table2]"

Dim SqlConnectionString As String

SqlConnectionString = "Data Source=(serverName);Initial Catalog=(databaseName);Integrated Security=True"

SqlDatasource1.ConnectionString = SqlConnectionString

SqlDatasource1.SelectCommandType = SqlDataSourceCommandType.Text

SqlDatasource1.SelectCommand = sSQLDataSource
SqlDatasource1.DataBind()

GridView1.DataSource = SqlDatasource1
GridView1.DataBind()
-
Any enlightenment with what I'm missing with the Bound GridView would be greatly appreciated.
AnswerRe: Resolved: Gridview SqlDataSource SelectCommand Pin
Tomb42117-Mar-09 9:24
Tomb42117-Mar-09 9:24 
Questionexport an image from sql 2005 to excel Pin
tw-de12-Mar-09 1:54
tw-de12-Mar-09 1:54 
AnswerRe: export an image from sql 2005 to excel Pin
Eddy Vluggen12-Mar-09 4:36
professionalEddy Vluggen12-Mar-09 4:36 
QuestionHow to use typed datasets with relationships. Pin
steve.borman12-Mar-09 0:48
steve.borman12-Mar-09 0:48 
QuestionPopulate Datagrid control Pin
tatchung12-Mar-09 0:11
tatchung12-Mar-09 0:11 
QuestionPrint Screen Pin
afridy11-Mar-09 20:18
afridy11-Mar-09 20:18 
AnswerRe: Print Screen Pin
Expert Coming11-Mar-09 22:32
Expert Coming11-Mar-09 22:32 
GeneralRe: Print Screen Pin
afridy11-Mar-09 23:24
afridy11-Mar-09 23:24 
QuestionA textbox with squiggly lines in different colours Pin
jinxster11-Mar-09 20:04
professionaljinxster11-Mar-09 20:04 
AnswerRe: A textbox with squiggly lines in different colours Pin
dan!sh 11-Mar-09 20:23
professional dan!sh 11-Mar-09 20:23 
GeneralRe: A textbox with squiggly lines in different colours Pin
Expert Coming11-Mar-09 22:33
Expert Coming11-Mar-09 22:33 
GeneralRe: A textbox with squiggly lines in different colours Pin
dan!sh 11-Mar-09 22:53
professional dan!sh 11-Mar-09 22:53 
GeneralRe: A textbox with squiggly lines in different colours Pin
Expert Coming11-Mar-09 23:03
Expert Coming11-Mar-09 23:03 
AnswerRe: A textbox with squiggly lines in different colours Pin
Expert Coming11-Mar-09 22:34
Expert Coming11-Mar-09 22:34 
QuestionCompare data of the last day with the past 4 day’s data Pin
Dobrobit11-Mar-09 18:14
Dobrobit11-Mar-09 18:14 
AnswerRe: Compare data of the last day with the past 4 day’s data Pin
Jumping Jupiter12-Mar-09 7:05
Jumping Jupiter12-Mar-09 7:05 
GeneralRe: Compare data of the last day with the past 4 day’s data Pin
Dobrobit12-Mar-09 11:16
Dobrobit12-Mar-09 11:16 

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.