3
Answers

how to bind drpdownlist from the oracle db in mvc ?

Anjali Khan

Anjali Khan

8y
263
1

hi frnds

i have a fields in data base like

USER_ID VARCHAR2(100 CHAR)

USER_NAME VARCHAR2(250 CHAR)

ROLE_ID NUMBER(38,0) No

and some data filled in data base .
now i want bind dropdown list from the data base and dropdown should be display data
dont want to use entity framework.here we can use procedure in oracle
so please help on this how to do this in mvc

Answers (3)
0
Raja

Raja

NA 1.7k 45.3k 8y
This is Web.config Code
~~~~~~~~~~~~~~~~~~~~
 
 
 
<configuration>
  <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
    </authentication>
    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
      </providers>
    </membership>
    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>
    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
      </providers>
    </roleManager>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  <rewrite>
    <rules>
      <rule name="Fail Bad request">
        <match url=".*"/>
        <conditions>
          <add input="{HTTP_HOST}" pattern="localhost" negate="true"/>
        </conditions>
        <action types="AbortRequest"/>

      </rule>
      <rule name="Redirect From Blog">
        <match url="^blog/([_0-9a-z-]+)/([0-9]+)" />
        <action type="Redirect" url="article/{R:2}/{R:1}" redirectType="Found"/>

      </rule>
      <rule name="Rewrite to article.aspx">
        <match url="^article/([0-9]+)/([_0-9a-z-]+)" />
        <action type="Rewrite" url="article.aspx?id={R:1}&amp;title={R:2}"/>
        </rule>
      </rules>
  </rewrite>
</configuration>
0
Manas Mohapatra

Manas Mohapatra

NA 29.3k 3.3m 8y
Please put the urlrewrite tag in proper place(proper tag). Provide the code how you are writing in web.config file..