Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

NarVish

@NarVish
About
Posts
303
Topics
141
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MVC: HTTP Error 403.14 - Forbidden; The Web server is configured to not list the contents of this directory.
    N NarVish

    I am working on mvc5, visual studio 2013. Till 3 hours back, my application is working fine. All of a sudden, I'm getting below error "HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. Most likely causes: A default document is not configured for the requested URL, and directory browsing is not enabled on the server." Note: My application is running on IISExpress I googled and tried the below solutions.Still not working. Please help me to fix this.. 1. added system.webservices tag in web.config as shown in the below link. http://forums.asp.net/t/1897460.aspx?the+web+server+is+configured+to+not+list+the+contents+of+this+directory 2. Run the below command in Command prompt. It allowed me to browse the directories C:\Program Files\IIS Express>appcmd set config /section:system.webServer/directoryBrowse /enabled:true Still error exists. 3. executed below command in command prompt %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir How to fix this..

    Web Development asp-net help csharp visual-studio sysadmin

  • MVC5: DropdownlistFor: How to handle empty data
    N NarVish

    Hi, I created dropdownlist in my view and controller as below. If ViewBag.CategoryList is null, it is throwing exception. how to handle the exception. Please guide me. Thank you.

    @Html.DropDownListFor(m => m.Category, (IEnumerable<SelectListItem>)ViewBag.CategoryList)

    Code is:

    DataTable dt = registrationDAO.GetParameters("PSTND");

    List<SelectListItem> positions = new List<SelectListItem>();
    foreach (DataRow dr in dt.Rows)
    {
    positions.Add(new SelectListItem { Text = dr["PARAM_VALUE"].ToString() });
    }
    ViewBag.CategoryList = positions;

    Web Development tutorial html

  • TypeError: $(...).autocomplete is not a function
    N NarVish

    yes. I googled and added scripts. but no use. I followed the code which is in below link http://www.itorian.com/2013/02/jquery-ui-autocomplete-with-json-in-mvc.html[^]

    Web Development javascript help css wpf design

  • TypeError: $(...).autocomplete is not a function
    N NarVish

    I tried, still it is giving same error

    $(function () {

        $("#userName").autocomplete({
            source: function (request, response) {
                 
                $.ajax({
                    url: "~/Home/AutoCompleteName",
                    type: "POST",
                    dataType: "json",
                    data: { term: request.term },
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item.Country, value: item.Country };
                        }))
                    }
                })
            },
            messages: {
                noResults: "", results: ""
            }
        });
    })
    
    Web Development javascript help css wpf design

  • TypeError: $(...).autocomplete is not a function
    N NarVish

    I'm trying to implement autocomplete feature for my search text box. Fire bug shows the error shown in subject. Please let me know my mistake. Please find my code below.

    @model MvcApplication1.Models.UserProfile

    @{
    ViewBag.Title = "UserProfile";
    }

    <form method="post">
    <input type="text" name="userName" />
    <input type="submit" value="Search By Name" />
    </form>

    @foreach (var item in ViewBag.users)
    {
    

    @item.UserName

                @item.Country
            
    
            
    
                Mail: @item.Email
    

    }
    

    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script src="~/Scripts/jquery-ui-1.9.2.min.js"></script>
    @Styles.Render("~/Content/themes/base/css")

    <script type="text/javascript">
    $(document).ready(function () {

        $("#userName").autocomplete({
            source: function (request, response) {
                 
                $.ajax({
                    url: "~/Home/AutoCompleteName",
                    type: "POST",
                    dataType: "json",
                    data: { term: request.term },
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item.Country, value: item.Country };
                        }))
                    }
                })
            },
            messages: {
                noResults: "", results: ""
            }
        });
    })
    

    </script>

    Code in Controller:

    public ActionResult UserProfile(string userName = null)
    {
    string conString = "User Id=RDB; password=RDB; Data Source=172.18.164.146:1521/XE; Pooling=false;";

            OracleConnection con = new OracleConnection();
            con.ConnectionString = conString;
            con.Open();
    
            OracleCommand cmd = con.CreateCommand();
            cmd.CommandText = "select USR\_USERNAME, USR\_COUNTRY, USR\_EMAIL\_ADDR from OBRS\_USER";
    
            OracleDataReader reader = cmd.ExecuteReader();
            \_db.UserProfiles = new List();
            UserProfile user;
            while (reader.Read())
            {
                user = new UserProfile();
                user.UserName = reader.GetString(0);
                user.Coun
    
    Web Development javascript help css wpf design

  • Error When click on login in MVC4
    N NarVish

    I haven't done any code changes. I just want to go through the built-in functionality which is ready to use. Exception occurred in Filters->InitializeSimpleMembershipAttribute.cs method: OnActionExecuting Line: LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);

    Web Development csharp visual-studio asp-net wpf help

  • Error When click on login in MVC4
    N NarVish

    Hi, I've installed VS 2013 Professional Edition and created a project as shown below 1. File->New Project 2. Templates->Visual C#->Web->Visual Studio 2012 3. Selected ASP.Net MVC4 Web Application and clicked on OK button A new project got created. I haven't done any code changes. Run the application using internet Explorer. Its working fine and when I clicked on Login link, below exception was thrown. Please let me know if I missed anything. Exception: An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll but was not handled in user code Exception occurred in Filters->InitializeSimpleMembershipAttribute.cs method: OnActionExecuting Line: LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock); Thanks in advance.

    Web Development csharp visual-studio asp-net wpf help

  • SqlDataReader is not returning all rows
    N NarVish

    One of the line in using section is reading the first record. In while loop, it is reading from second record. I removed the below if condition and it worked fine. Thank you all for your replies. Sorry for not posting that line, as I thought that line is handling only exception. if (!reader.Read()) throw new ApplicationException("MISSING Transaction Returned By Financial Institution. Transaction was not found in the database."); while (reader.Read()) {}

    C# database

  • SqlDataReader is not returning all rows
    N NarVish

    DataReader didn't read first record.

    C# database

  • SqlDataReader is not returning all rows
    N NarVish

    If I run the query on database (SQL GUI), it is showing three records

    C# database

  • SqlDataReader is not returning all rows
    N NarVish

    Just to show the difference, I added the SqlDataAdapter code. It will be removed.

    C# database

  • SqlDataReader is not returning all rows
    N NarVish

    My SQL command returns 3 rows which is verified in a SQL GUI. I run the same code and SqlDataReader returns only 2 of them. The same sql command returns 3 rows with SqlDataAdapter. Here is my code. ds has 3 rows.

    using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["VPO"].ConnectionString))
    {
    string sql="SELECT DISTINCT A.account_id, A.fname, A.lname,
    FROM T_Test1 A WITH (NOLOCK) JOIN T_Test2 AF WITH (NOLOCK) ON A.Account_id=AF.Account_id
    WHERE account_status = 'A' AND A.card IS NOT NULL
    AND A.dateFrom >= '09-02-2013 00:00:00' AND A.dateFrom <= '09-30-2013 00:00:00' AND AF.code = 'INE'";
    SqlCommand command = new SqlCommand(sql.ToString(), connection);
    command.CommandTimeout = 3600;
    connection.Open();
    using (SqlDataReader reader = command.ExecuteReader())
    {
    while (reader.Read())
    {}
    }
    DataSet ds = new DataSet();
    SqlDataAdapter da = new SqlDataAdapter(command.CommandText, connection);
    da.Fill(ds);
    }

    C# database

  • Error: External table is not in the expected format
    N NarVish

    I followed below steps to make it work. Now, I'm able to read file 1. open your excel file 2. try to read that 3. Able to read the file 4. to read the file next time, no need to open the file. I don't know the reason how and why its working :)

    C# help tutorial

  • Error: External table is not in the expected format
    N NarVish

    :) I'm reading that data source value in runtime. so blackslash is not an issue.

    C# help tutorial

  • Error: External table is not in the expected format
    N NarVish

    I used the below connection string as mentioned in the given article. Still error exists connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\test.xlsx;Extended Properties=\"Excel 12.0;HDR=NO\"";

    C# help tutorial

  • Error: External table is not in the expected format
    N NarVish

    Hi, I used the below connection string to read excel file. connectionString = "Provider=Microsoft.Jet.OLEDB.12.0;Data Source=D:\test2.xlsx;Extended Properties=\'Excel 12.0;HDR=No;\"; While opening, an exception is thrown.. "External table is not in the expected format" I explored in serveral sites and changed the connection string as mentioned there and followed other solutions. But none of them didn't work. Please guide me to solve this issue. Thanks in advance.

    C# help tutorial

  • Can I display links in a ListView's detail mode?
    N NarVish

    In my windown application, I have a listview, which contains two columns. One of the subitem in a row contains the data as below. "Failed testcase path=C:\temp\test.jpg" I need to provide hyperlink to only "C:\temp\test.jpg". If I click on the same, it should open the corresponding image. I tried by changing the property HotTaracking to true.

    listView1.HotTracking = true;

    But it shows hyperlinks to all the rows in listview. Is there a way to achieve this?

    C# question

  • get datetime values from database in dd/MM/yyyy HH:mm:ss format irrespective of system date/time format
    N NarVish

    Thank you, hemantrautela. Due to hectic schedule, couldn't able to solve this small issue. Thank you once again

    C# database tutorial csharp sql-server sysadmin

  • get datetime values from database in dd/MM/yyyy HH:mm:ss format irrespective of system date/time format
    N NarVish

    I run the below query in SQL server through C#. SELECT ScheduleTime FROM test I'm using SqlDataAdapter to fill the results in datatable. I'm getting "ScheduleTime" values from test table ("ScheduleTime" is datetime type). But the results are in system date time format. For example, if my system Time format is "tt hh:mm:ss" in Long Time, the results are in the below format. 27-03-2013 PM 03:51:01 if my system Time format is "HH:mm:ss" in Long Time, the results are in the below format. 27-03-2013 15:51:01 I need to get the results in dd/MM/yyyy HH:mm:ss format irrespective of system date/time format. Please guide me to this. Thanks in advance.

    C# database tutorial csharp sql-server sysadmin

  • How to append connectionString from one config file to other config file
    N NarVish

    Hi, I'm trying to copy connectionStrings from C:\test2\web.config to c:\test1\app.config. In web.config, connectionString element looks as below. both config files are not belong to my project.

    <connectionStrings>
    <add name="SqlServerConnectionString" connectionString="server=NAPALDEVDBS02.dev.psisystems.local\DEV08; database=VPO1; User ID={0}; Password={1}; Pooling=True; Min Pool Size=5; Max Pool Size=40; Connect Timeout=10;" providerName="System.Data.SqlClient" />
    <add name="SqlServerConnectionPropertiesString" connectionString="Initial Catalog=VPO1;Integrated Security=False;Uid=WSAccountData;Pwd=drUc5u8r;" providerName="System.Data.SqlClient" />
    <add name="VPO1" connectionString="server=NAPALDEVDBS02.dev.psisystems.local\DEV08; database=VPO1; User ID=VPOServer; Password=Mon186ster;" />
    </connectionStrings>

    ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();

    fileMap.ExeConfigFilename = @"c:\test1\app.config";
    Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);

    var connectionStringsSection = (ConnectionStringsSection)config.GetSection("connectionStrings");

    ExeConfigurationFileMap fileMapWeb = new ExeConfigurationFileMap();
    fileMapWeb.ExeConfigFilename = @"C:\test2\web.config";
    Configuration configWeb = ConfigurationManager.OpenMappedExeConfiguration(fileMapWeb, ConfigurationUserLevel.None);

    var connectionStringsWeb = (ConnectionStringsSection)configWeb.GetSection("connectionStrings");

    //here I got connectionString element in connectionStringsWeb from web.config file. But how to append this connectionString element to app.config file.

    Thanks in advance.

    C# database sysadmin security tutorial workspace
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups