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


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

Создается подключение в событии 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
ASP.NET 2.0 : Проблемы...
    #33862934
Den!
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: plaintext
1.
2.
3.
4.
DropDownList1.DataTextField = ???;
DropDownList1.DataValueField = ???;

DropDownList1.DataBind();
...
Рейтинг: 0 / 0
ASP.NET 2.0 : Проблемы...
    #33866121
DiscoDancer
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Это не помогло...
 
Решил поэксперементированить с 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
3 сообщений из 3, страница 1 из 1
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / ASP.NET 2.0 : Проблемы...
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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