Solved

CS0246: The type or namespace name 'OdbcConnection' could not be found ? URGENT.

Posted on 2004-10-27
6,828 Views
Last Modified: 2013-12-03
I had this error before I am porting to a new machine. I forget,

Server Error in '/MSPOS' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'OdbcConnection' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

 

Line 18: protected string AccessLevel = null;
Line 19: private DataSet ddlDataSet = new DataSet();
Line 20: private OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
Line 21: private DataSet ddlDataSet1 = new DataSet();
Line 22:
 

Source File: D:\Inetpub\wwwroot\MSPOS\Stores.aspx    Line: 20



Show Detailed Compiler Output:


d:\windows\system32\inetsrv> "d:\windows\microsoft.net\framework\v1.1.4322\csc.exe" /t:library /utf8output /R:"d:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"d:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"d:\windows\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"d:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"d:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"d:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\7fd4084b\87fe2220\assembly\dl2\171e319b\dc920985_a2bcc401\mspos.dll" /R:"d:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"d:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"d:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\7fd4084b\87fe2220\qzbr_fdy.dll" /R:"d:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll" /R:"d:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\7fd4084b\87fe2220\6hscqljy.dll" /R:"d:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\7fd4084b\87fe2220\ibvlyra1.dll" /R:"d:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\7fd4084b\87fe2220\cipkv1wy.dll" /R:"d:\windows\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"d:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\7fd4084b\87fe2220\assembly\dl2\c46bda45\00435b3c_0eb5c401\activedatetime.dll" /out:"D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\7fd4084b\87fe2220\d8yhho_9.dll" /D:DEBUG /debug+ /optimize- /win32res:"D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\7fd4084b\87fe2220\d8yhho_9.res" /warnaserror /w:1 /R:"D:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"  "D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\7fd4084b\87fe2220\d8yhho_9.0.cs"


Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

D:\Inetpub\wwwroot\MSPOS\Stores.aspx(20,9): error CS0246: The type or namespace name 'OdbcConnection' could not be found (are you missing a using directive or an assembly reference?)

 


my aspx:

<%@ Page Language="c#" CompilerOptions='/R:"D:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"'%>
<%@ Register TagPrefix="mspos" TagName="footer" Src="~/Engine/Controls/footer.ascx" %>
<%@ Register TagPrefix="mspos" TagName="header" Src="~/Engine/Controls/header.ascx" %>
<%@ import namespace="System.Data" %>
<%@ import namespace="System.Text" %>
<%@ import namespace="System.Collections" %>
<%@ import namespace="System.ComponentModel" %>
<%@ import namespace="System.Drawing" %>
<%@ import namespace="System.Web" %>
<%@ import namespace="System.Web.SessionState" %>
<%@ import namespace="System.Web.UI" %>
<%@ Register TagPrefix="uc1" TagName="logout" Src="Engine/Controls/logout.ascx" %>
<HTML>
<HEAD>
<title>Users Interface to Managing Adminitrators</title>
<meta content="True" name="vs_snapToGrid">
<script language="C#" runat="server">
protected string AccessLevel = null;
private DataSet ddlDataSet = new DataSet();
private OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
private DataSet ddlDataSet1 = new DataSet();

private void MainMenu_Click(Object sender, ImageClickEventArgs e)
{
   AccessLevel = Session["Authenticated"].ToString();
      if (AccessLevel == "1")
            Response.Redirect("AdminStart.aspx");        
      else if (AccessLevel == "2")
            Response.Redirect("CCManStart.aspx");        
      else if (AccessLevel == "3")
            Response.Redirect("CCashierStart.aspx");        
      else if (AccessLevel == "4")
            Response.Redirect("CashierStart.aspx");        
      else Response.Redirect("Error.aspx");
}

//************************************************************
// Get Stores and populate dataset with STOREID and Store
private DataSet BindStores()
{
      OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");

    // Populate the ddlDataSet
   myConnection.Open();
   const string strSQLDDL = @"SELECT STOREID, STORE FROM TBSTORES ORDER BY STOREID";
   OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
   ddlDataSet1.Clear();  
   myDataAdapter.Fill(ddlDataSet1, "ddlStores");
   myDataAdapter.Dispose();
   myDataAdapter = null;
   myConnection.Close();
   return ddlDataSet1;
}
//************************************************************
 
 
 
//****************************************************************
protected void Page_Load(object sender, System.EventArgs e)
{
      if (!Page.IsPostBack)
      {
            BindData();
      }
}
//****************************************************************



//****************************************************************
private void BindData()
{
      OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
    myConnection.Open();
         
    // get records from the table
    string commandString = @"SELECT STOREID, STORE FROM TBSTORES ORDER BY STOREID";      
    // Set the datagrid's datasource to the datareader and databind
    // Create a OdbcCommand object and assign the connection connect to the database
    OdbcCommand command = myConnection.CreateCommand( );
    command.CommandText = commandString;
    command.Connection = myConnection;
      // Create the Reader and bind it to the datagrid
    OdbcDataReader reader =  command.ExecuteReader(CommandBehavior.CloseConnection);
    DataGridUserManagementID.DataSource=reader;
    DataGridUserManagementID.DataBind();
      reader.Close();
      reader=null;
    myConnection.Dispose();
      myConnection.Close();
          
}
//****************************************************************

//************************************************************
private void DataGridUserManagementID_SelectedIndexChanged(object sender, System.EventArgs e)
{
      int intCount;
      for (intCount = 1; intCount <= DataGridUserManagementID.Items.Count; intCount ++)
          DataGridUserManagementID.Items[intCount - 1].BorderStyle =  BorderStyle.Groove;

      DataGridUserManagementID.SelectedItem.BorderStyle = BorderStyle.Dashed;
}
//************************************************************



//****************************************************************
private void DataGridUserManagementID_Delete(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    // Get the StoreID of the row whose Delete button was clicked
   
    string strStoreID = ((Label)e.Item.FindControl("lblStoreID")).Text;
    int SelectedStoreID = Convert.ToInt32(strStoreID);
      string strSQL="Delete From TBSTORES where STOREID='"+ SelectedStoreID +"'";
    ExecuteQuery(strSQL);
    DataGridUserManagementID.EditItemIndex = -1;
    BindData();
}
//****************************************************************



//***************************************************************
private int ExecuteQuery(string sqlCmd)
{
   // Create a OdbcCommand object and assign the connection connect to the database
   OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
   myConnection.Open();
   OdbcCommand command = myConnection.CreateCommand( );
   command.CommandText = sqlCmd;
   command.Connection = myConnection;
   return command.ExecuteNonQuery();
}
//***************************************************************



//***************************************************************
private void DataGridUserManagementID_Update(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    // Determine what store was selected
    string strStoreID, strStore;
    // Declare Textboxes
       // Gets the value of the key field of the row being updated
      strStoreID = ((Label)e.Item.FindControl("lblStoreID")).Text;
    strStore = ((TextBox)e.Item.FindControl("editStores")).Text;    
     
   
      // form the update statement
    // connect to the database
      string cmd="Update TBSTORES Set STORE='"+ strStore +"' Where StoreID = "+ strStoreID +"";
         ExecuteQuery(cmd);
         DataGridUserManagementID.EditItemIndex = -1;
    BindData(  );
   
}
//************************************************************************



//************************************************************************
protected int GetSelectedIndexStore(string StoreID)
{  
   int iLoop;  
   DataTable dt = ddlDataSet1.Tables["ddlStores"];  
   for (iLoop=0; iLoop < dt.Rows.Count - 1; iLoop++)
   {  
            if (StoreID.Equals(dt.Rows[iLoop]["STOREID"].ToString()))  
              return iLoop;  
   };  
   return 0;  
 
}
//***************************************************************


//****************************************************************
private void DataGridUserManagementID_Edit(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
      DataGridUserManagementID.EditItemIndex = e.Item.ItemIndex;
    BindData();
}
//****************************************************************



//************************************************************************
protected void DataGridUserManagementID_ItemCreated(Object sender, DataGridItemEventArgs e)
{
      if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
      {
            ImageButton btn = (ImageButton)e.Item.FindControl("btnDel");
          btn.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item.')");
      }
}
//************************************************************************


//******************************************************************************
private void DataGridUserManagementID_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
    ListItemType oType = ((ListItemType)e.Item.ItemType);
    if(oType == ListItemType.Item || oType == ListItemType.AlternatingItem)
    {
            e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='lightblue'");            
            e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='Beige'");            
      }


}
//***************************************************************


//************************************************************************
protected void DataGridUserManagementID_ItemCommand(object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{

    if (e.CommandName == "Insert")
    {
       TextBox txtStore;
       ///... declarations for remaining data fields
 
       string strSQL;
         string storename;
        
         txtStore = (TextBox)e.Item.FindControl("add_storeID");
       storename = txtStore.Text;
       OdbcCommand command = myConnection.CreateCommand( );
         command.Connection = myConnection;
       
       // Create the appropriate SQL statement
       strSQL = "INSERT INTO TBSTORES (STORE) VALUES ('" +storename+"'"+")";
       if (storename != "")
                  ExecuteQuery(strSQL);
       DataGridUserManagementID.EditItemIndex = -1;
       BindData();
    }
}
//************************************************************************


//****************************************************************
private void DataGridUserManagementID_Cancel(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    DataGridUserManagementID.EditItemIndex = -1;
    BindData();
}
//****************************************************************

            </script>
</HEAD>
<body bgColor="#fef9e9" leftMargin="0" background="images/bg.gif" topMargin="0" marginwidth="0"
            marginheigh="0">
<mspos:header id="header" runat="server"></mspos:header>
<center>
<form id="form1" runat="server">
<TABLE height="380" cellSpacing="0" cellPadding="0" width="587" border="0" ms_2d_layout="TRUE">
<TR vAlign="top">
<TD width="368" height="29">
<!-- Include start of header --------------------------------------------></TD>
<TD width="575" height="29">
<P align="center"><BR>
<asp:imagebutton id="Imagebutton1" onclick="MainMenu_Click" runat="server" ImageUrl="images/main.jpg"></asp:imagebutton><BR>
<BR>
</P>
</TD>
<TD width="702" height="29"></TD>
</TR>
<TR vAlign="top">
<TD width="368" height="272"></TD>
<TD width="575" height="272"><asp:datagrid id="DataGridUserManagementID" runat="server" BorderWidth="3" BorderColor="#CCCC99"
                                                PagerStyle-HorizontalAlign="Right" width="449px" font-names="Verdana" font-size="xx-small"
                                                BorderStyle="Outset" GridLines="None" AutoGenerateColumns="False" ShowFooter="True" AllowCustomPaging="True"
                                                AllowPaging="True" OnItemCommand="DataGridUserManagementID_ItemCommand" OnItemCreated="DataGridUserManagementID_ItemCreated"
                                                OnEditCommand="DataGridUserManagementID_Edit" OnItemDataBound="DataGridUserManagementID_ItemDataBound"
                                                OnCancelCommand="DataGridUserManagementID_Cancel" OnUpdateCommand="DataGridUserManagementID_Update"
                                                OnDeleteCommand="DataGridUserManagementID_Delete">
<FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
<SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle>
<AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
<ItemStyle BackColor="Beige"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#954896"></HeaderStyle>
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="&lt;img src=images/Ok.gif border=0 align=absmiddle alt='Save changes'&gt;"
                                                            CancelText="&lt;img src=images/Cancel.gif border=0 align=absmiddle alt='Cancel editing'&gt;"
                                                            EditText="&lt;img src=images/icn_edit.gif border=0 align=absmiddle alt='Edit this item'&gt;"></asp:EditCommandColumn>
<asp:TemplateColumn HeaderText="StoreID">
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem, "STOREID")) %>' Font-Bold="true" Runat="server" ID="lblStoreID">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Store Name">
<ItemTemplate>
<asp:Label id=lblStore Runat="server" Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem,"STORE")) %>'>
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox id="add_storeID" Width="150" runat="server"></asp:TextBox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox id=editStores Width="150" Runat="server" Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem,"STORE")) %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Delete">
<ItemTemplate>
<asp:ImageButton CommandName="Delete" id="btnDel" runat="server" Runat="server" alt='Delete this item?'
                                                                        ImageUrl="images/icn_del.gif"></asp:ImageButton>
</ItemTemplate>
<FooterTemplate>
<asp:ImageButton CommandName="Insert" id="btnAdd" runat="server" alt='Add new item' ImageUrl="images/icn_add.gif"></asp:ImageButton>
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle>
</asp:datagrid>
<P align="center">
<uc1:logout id="Logout1" runat="server"></uc1:logout><BR>
<BR>
<mspos:footer id="footer" runat="server"></mspos:footer></P>
</TD>
<TD height="272"></TD>
</TR>
</TABLE>
</form>
</center> <!-- Include start of footer ------------------------------------------------> <!--------------------------------------------------------------------------->
</body>
</HTML>
0
Question by:mathieu_cupryk
    9 Comments
     
    LVL 15

    Accepted Solution

    by:
    The OdbcConnection class is part of the System.Data.Odbc namespace, so make sure that you add a

        <%@ import namespace="System.Data.Odbc" %>

    statement near the top of your file (amongst the other <%@ import ... %> statements).
    0
     
    LVL 8

    Assisted Solution

    by:daffodils
    Add this line:
    <%@ import namespace="System.Data.Odbc" %>
    0
     
    LVL 15

    Expert Comment

    by:Thogek
    Is there an echo in here?  ;-)
    0
     

    Author Comment

    by:mathieu_cupryk
    <%@ Page Language="c#" CompilerOptions='/R:"D:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"'%>
    <%@ Register TagPrefix="uc1" TagName="logout" Src="Engine/Controls/logout.ascx" %>
    <%@ import namespace="System.Data.Odbc" %>
    <%@ import namespace="System.Web.UI" %>
    <%@ import namespace="System.Web.SessionState" %>
    <%@ import namespace="System.Web" %>
    <%@ import namespace="System.Drawing" %>
    <%@ import namespace="System.ComponentModel" %>
    <%@ import namespace="System.Collections" %>
    <%@ import namespace="System.Text" %>
    <%@ import namespace="System.Data" %>
    <%@ Register TagPrefix="mspos" TagName="header" Src="~/Engine/Controls/header.ascx" %>
    <%@ Register TagPrefix="mspos" TagName="footer" Src="~/Engine/Controls/footer.ascx" %>

    I still get


    Server Error in '/MSPOS' Application.
    --------------------------------------------------------------------------------

    ERROR [IM003] Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).
    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.Data.Odbc.OdbcException: ERROR [IM003] Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).

    Source Error:


    Line 73: {
    Line 74:       OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
    Line 75:     myConnection.Open();
    Line 76:          
    Line 77:     // get records from the table
     

    Source File: D:\Inetpub\wwwroot\MSPOS\Stores.aspx    Line: 75

    Stack Trace:


    [OdbcException: ERROR [IM003] Specified driver could not be loaded due to system error  5 (Oracle in OraHome92).]
       System.Data.Odbc.OdbcConnection.Open() +638
       ASP.Stores_aspx.BindData() in D:\Inetpub\wwwroot\MSPOS\Stores.aspx:75
       ASP.Stores_aspx.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\MSPOS\Stores.aspx:64
       System.Web.UI.Control.OnLoad(EventArgs e) +67
       System.Web.UI.Control.LoadRecursive() +35
       System.Web.UI.Page.ProcessRequestMain() +731

     

    0
     

    Author Comment

    by:mathieu_cupryk
    Server Error in '/MSPOS' Application.
    --------------------------------------------------------------------------------

    ERROR [IM003] Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).
    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.Data.Odbc.OdbcException: ERROR [IM003] Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).

    Source Error:


    Line 73: {
    Line 74:       OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
    Line 75:     myConnection.Open();
    Line 76:          
    Line 77:     // get records from the table
     

    Source File: D:\Inetpub\wwwroot\MSPOS\Stores.aspx    Line: 75

    Stack Trace:
    I still get the following error:

    [OdbcException: ERROR [IM003] Specified driver could not be loaded due to system error  5 (Oracle in OraHome92).]
       System.Data.Odbc.OdbcConnection.Open() +638
       ASP.Stores_aspx.BindData() in D:\Inetpub\wwwroot\MSPOS\Stores.aspx:75
       ASP.Stores_aspx.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\MSPOS\Stores.aspx:64
       System.Web.UI.Control.OnLoad(EventArgs e) +67
       System.Web.UI.Control.LoadRecursive() +35
       System.Web.UI.Page.ProcessRequestMain() +731

     


    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
    0
     

    Author Comment

    by:mathieu_cupryk
    Here is another error when I migrate:

    Auth Exception: Microsoft.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified at Microsoft.Data.Odbc.OdbcConnection.Open() at MSPOS.login.Authenticate(String username, String password) in D:\Inetpub\wwwroot\MSPOS\login.aspx.cs:line 90
    0
     

    Author Comment

    by:mathieu_cupryk
    Here is the code for the above error.

    <%@ Page language="c#" Codebehind="login.aspx.cs" CompilerOptions='/R:"D:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"' AutoEventWireup="false" Inherits="MSPOS.login" %>
    <%@ import namespace="System.Data.Odbc" %>
    <%@ Register TagPrefix="uc1" TagName="footer" Src="Engine/Controls/footer.ascx" %>
    <%@ Register TagPrefix="mspos" TagName="header" Src="~/Engine/Controls/header.ascx" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
          <HEAD>
                <title></title>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          </HEAD>
          <body background="images/bg.gif" leftMargin="0" topMargin="0" marginheigh="0" marginwidth="0"
                bgColor="#fef9e9">
                <table cellspacing="0" cellpadding="0" width="100%" border="0">
                      <tbody>
                            <tr>
                                  <td>
                                        <mspos:header id="Header1" runat="server"></mspos:header>
                                  </td><LINK rel="stylesheet" type="text/css" href="http://localhost/MSPOS/mspos.css">
                            </tr>
                            <tr>
                                  <td>&nbsp;
                                  </td>
                            </tr>
                            <tr>
                                  <td valign="middle" align="center">
                                        <form id="login" name="form1" method="post" runat="server">
                                              <asp:validationsummary id="ValidationSummary1" runat="server" HeaderText="The following error(s) occurred while login in:"></asp:validationsummary>
                                              <P>
                                                    <asp:label id="lbPrompt" runat="server"></asp:label></P>
                                              <table bordercolor="#cccc99" cellspacing="0" cellpadding="0" width="369" align="center"
                                                    border="2" bgColor="#fef9e9" height="176">
                                                    <tbody>
                                                          <tr>
                                                                <td align="center">
                                                                      <table cellspacing="4" cellpadding="3" width="100%" background="file:///D|/webprojects/vipdotnet/images/tdback.jpg"
                                                                            border="0">
                                                                            <tbody>
                                                                                  <tr>
                                                                                        <td nowrap colspan="2">
                                                                                              <P align="center"><FONT face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="2"><STRONG>Please
                                                                                                                Enter your Username and Password</STRONG></FONT></P>
                                                                                        </td>
                                                                                  </tr>
                                                                                  <tr>
                                                                                        <td>
                                                                                              <P align="right">
                                                                                                    <IMG height="40" src="images/key.gif" width="36">&nbsp;</P>
                                                                                        </td>
                                                                                        <td>&nbsp; <FONT color="#adae7d"><STRONG><FONT face="Arial">User Login</FONT></STRONG></FONT>
                                                                                        </td>
                                                                                  </tr>
                                                                                  <tr>
                                                                                        <td>
                                                                                              <div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">User
                                                                                                          Name:</font>
                                                                                              </div>
                                                                                        </td>
                                                                                        <td>
                                                                                              <asp:textbox id="UserName" runat="server" TextMode="SingleLine" MaxLength="32" Width="150px"></asp:textbox>
                                                                                              <asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" ControlToValidate="Username" Display="Dynamic"
                                                                                                    ErrorMessage="You must enter a Username">*</asp:requiredfieldvalidator>
                                                                                        </td>
                                                                                  </tr>
                                                                                  <tr>
                                                                                        <td>
                                                                                              <div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Password:</font>
                                                                                              </div>
                                                                                        </td>
                                                                                        <td>
                                                                                              <asp:textbox id="Password" runat="server" TextMode="Password" MaxLength="40" Width="150px"></asp:textbox>
                                                                                              <asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" ControlToValidate="Password" Display="Dynamic"
                                                                                                    ErrorMessage="You must enter a Password">*</asp:requiredfieldvalidator>
                                                                                        </td>
                                                                                  </tr>
                                                                                  <tr>
                                                                                        <td>&nbsp;
                                                                                        </td>
                                                                                        <td>
                                                                                              <asp:Button id="Button" runat="server" Text="Submit"></asp:Button></td>
                                                                                  </tr>
                                                                            </tbody>
                                                                      </table>
                                                                      <asp:label id="ErrorMsg" runat="server" ForeColor="Red"></asp:label>
                                                                </td>
                                                          </tr>
                                                    </tbody>
                                              </table>
                                        </form>
                                        <uc1:footer id="Footer1" runat="server"></uc1:footer>
                                        <asp:Label id="Message" runat="server"></asp:Label><BR>
                                  </td>
                            </tr>
                      </tbody>
                </table>
          </body>
    </HTML>
    0
     
    LVL 8

    Expert Comment

    by:daffodils
    Look at this article:
    http://asp-hosting.ca/faq/Connect-to-MySQL-database-from-ASP.NET.htm

    It Connects to MySQL database using ODBC .NET data provider and DSN-less connection.
    Some checkpoints from the article:
    -- Make sure you have installed the .Net Framework on your server
    -- Download the ODBC .Net data provider and install it on your server. You can find the download here: http://www.microsoft.com/downloads/release.asp?ReleaseID=35715
    -- Make sure that Microsoft.data.odbc.dll file is located in the following folder on your server C:\Program Files\Microsoft.NET\Odbc.Net\.
    -- Install Microsoft Data Access Components (MDAC) 2.6 or later. MDAC 2.8 is recommended. You can download it here: http://msdn.microsoft.com/data/
    -- Install MySQL Server.
    -- Install MySQL ODBC Driver-MyODBC 3.51. You can download it here: http://www.mysql.com/downloads/api-myodbc-3.51.html

    As an aside.........
    From what it looks like, you are trying to access the Oracle Database using a Microsoft Data Driver.

    You could try using:
    - System.Data.OracleClient (from Mircosoft)
    - Oracle.DataAccess.Client (from Oracle)

    Is there a reason why you are using ODBC to access Oracle? Try using OleDB.
    string sConnStr = "Password=[password];User ID=[userid];Data Source=myOracleDB;Persist Security Info=True";

    OracleConnection oConn = new OracleConnection();
    oConn.ConnectionString = sConnStr;

    Check the link for connection samples:
    http://www.able-consulting.com/dotnet/adonet/Data_Providers.htm#OLEDBManagedProvider
    0
     
    LVL 8

    Expert Comment

    by:daffodils
    Thogek,
    Echo was definitely there :)).. and I am working on my typing speed to get on the other side of Echo ;-)

    Have a great echo-free day :-)
    ~Ritu
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Shellfire Box VPN + Lifetime Subscription

    The Shellfire Box easily connects all of your devices, even those that don't offer the possibility to establish a safe vpn connection. Access blocked content and surf safely, no matter where in the world you are located.

    What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now