Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / ASP.NET 2.0 : Проблемы... / 3 сообщений из 3, страница 1 из 1
19.07.2006, 08:20
    #33862681
DiscoDancer
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
ASP.NET 2.0 : Проблемы...
Всем бодрого времени суток.


У меня такая проблема:

Создается подключение в событии Page_Load:protected void Page_Init(object sender, EventArgs e)
{
SqlDataSource adapter;
adapter = new SqlDataSource("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\\Vadim\\ktos_db\\Данные.mdb;Persist Security Info=True;Password=alexBR;User ID=al;Jet OLEDB:System database=G:\\Vadim\\ktos_db\\wg.mdw;Jet OLEDB:Database Password=alexBR", "SЕLECT Сокращение FROM Категория");
DropDownList1.DataSource = adapter;
DropDownList1.DataBind();
}


Но в этом самом DropDownList1 обсолютно ничего не отображается.

Если же пробовать через Через DropDownList1.DataSourceID и adapter.ID="ktos", то появляется ошибка:

The DataSourceID of 'DropDownList1' must be the ID of a control of type IDataSource.  A control with ID 'ktos' could not be found.



Как можно избавится от ошибки?


Заранее спасибо.
...
Рейтинг: 0 / 0
19.07.2006, 10:19
    #33862934
Den!
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
ASP.NET 2.0 : Проблемы...
Код: plaintext
1.
2.
3.
4.
DropDownList1.DataTextField = ???;
DropDownList1.DataValueField = ???;

DropDownList1.DataBind();
...
Рейтинг: 0 / 0
20.07.2006, 10:47
    #33866121
DiscoDancer
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
ASP.NET 2.0 : Проблемы...
Это не помогло...
 
Решил поэксперементированить с GridVew.
 
Писал тоже самое :
 adapter.ID = "ktos";
GridView1.DataSource = adapter;
GridView1.DataBind();




А в итоге на странице :
 
Unable to find the requested .Net Framework Data Provider.  It may not be installed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.
Source Error:

Line 18:         adapter.ID = "ktos";
Line 19:         GridView1.DataSource = adapter;
Line 20:         GridView1.DataBind();
Line 21:      
Line 22:        
 
Source File: c:\Inetpub\wwwroot\KtosTest\Default.aspx    Line: 20
Stack Trace:

[ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
   System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1371991
   System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactory() +63
   System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactorySecure() +19
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +120
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
   System.Web.UI.WebControls.GridView.DataBind() +4
   ASP.default_aspx.Page_Init(Object sender, EventArgs e) in c:\Inetpub\wwwroot\KtosTest\Default.aspx:20
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
   System.Web.UI.Control.OnInit(EventArgs e) +2069676
   System.Web.UI.Page.OnInit(EventArgs e) +9
   System.Web.UI.Control.InitRecursive(Control namingContainer) +321
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692
 

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
...
Рейтинг: 0 / 0
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / ASP.NET 2.0 : Проблемы... / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]