S
sck10
Hello,
I have a GridView that is using the following to connect to a SQL Server
2000 stored procedure:
<asp:SqlDataSource
ID="dsWebDocList" SelectCommand="sp_web_WebDocument"
ConnectionString="<%$ ConnectionStrings:cnnSQL_Connect %>" Runat="server">
<SelectParameters>
<asp
arameter Type="String" DefaultValue="FindWebDocAll"
Name="strParm01"></asp
arameter>
<asp
arameter Type="String" DefaultValue="Interlock"
Name="strParm02"></asp
arameter>
<asp
arameter Type="String" DefaultValue="1-1-2000"
Name="strParm03"></asp
arameter>
<asp
arameter Type="String" DefaultValue="NoParameter"
Name="strParm04"></asp
arameter>
<asp
arameter Type="String" DefaultValue="NoParameter"
Name="strParm05"></asp
arameter>
</SelectParameters>
</asp:SqlDataSource>
But for all my other controls, I am using code-behind and using something
like the following:
'Populate the GridView combo box
'------------------------------
Dim spGridView As OleDb.OleDbDataReader
Dim prmGridView As OleDbParameter
Dim cmdGridView As New OleDb.OleDbCommand("sp_web_WebDocument",
cnnSearch)
cmdGridView.CommandType = CommandType.StoredProcedure
'Declare Parameters
prmGridView = cmdGridView.Parameters.Add("@strParm01",
OleDbType.VarChar) : prmGridView.Value = "FindWebDocAll"
prmGridView = cmdGridView.Parameters.Add("@strParm02",
OleDbType.VarChar) : prmGridView.Value = "Interlock"
prmGridView = cmdGridView.Parameters.Add("@strParm03",
OleDbType.VarChar) : prmGridView.Value = "1-1-2000"
prmGridView = cmdGridView.Parameters.Add("@strParm04",
OleDbType.VarChar) : prmGridView.Value = "NoParameter"
prmGridView = cmdGridView.Parameters.Add("@strParm05",
OleDbType.VarChar) : prmGridView.Value = "NoParameter"
'Data Bind: DropdownList
spGridView = cmdGridView.ExecuteReader()
The problem I am having is that I can't bind the data to the GridView. I am
using the following:
'Data Bind: DropdownList
spGridView = cmdGridView.ExecuteReader()
gvWebDocList.DataSourceID = spGridView
gvWebDocList.DataBind()
Any help with this would be appreciated.
Thanks in advance, sck10
I have a GridView that is using the following to connect to a SQL Server
2000 stored procedure:
<asp:SqlDataSource
ID="dsWebDocList" SelectCommand="sp_web_WebDocument"
ConnectionString="<%$ ConnectionStrings:cnnSQL_Connect %>" Runat="server">
<SelectParameters>
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
Name="strParm01"></asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
Name="strParm02"></asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
Name="strParm03"></asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
Name="strParm04"></asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
Name="strParm05"></asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
</SelectParameters>
</asp:SqlDataSource>
But for all my other controls, I am using code-behind and using something
like the following:
'Populate the GridView combo box
'------------------------------
Dim spGridView As OleDb.OleDbDataReader
Dim prmGridView As OleDbParameter
Dim cmdGridView As New OleDb.OleDbCommand("sp_web_WebDocument",
cnnSearch)
cmdGridView.CommandType = CommandType.StoredProcedure
'Declare Parameters
prmGridView = cmdGridView.Parameters.Add("@strParm01",
OleDbType.VarChar) : prmGridView.Value = "FindWebDocAll"
prmGridView = cmdGridView.Parameters.Add("@strParm02",
OleDbType.VarChar) : prmGridView.Value = "Interlock"
prmGridView = cmdGridView.Parameters.Add("@strParm03",
OleDbType.VarChar) : prmGridView.Value = "1-1-2000"
prmGridView = cmdGridView.Parameters.Add("@strParm04",
OleDbType.VarChar) : prmGridView.Value = "NoParameter"
prmGridView = cmdGridView.Parameters.Add("@strParm05",
OleDbType.VarChar) : prmGridView.Value = "NoParameter"
'Data Bind: DropdownList
spGridView = cmdGridView.ExecuteReader()
The problem I am having is that I can't bind the data to the GridView. I am
using the following:
'Data Bind: DropdownList
spGridView = cmdGridView.ExecuteReader()
gvWebDocList.DataSourceID = spGridView
gvWebDocList.DataBind()
Any help with this would be appreciated.
Thanks in advance, sck10