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
S

solomon201

@solomon201
About
Posts
6
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • What is wrong with my ChildAction and razor view
    S solomon201

    I have this child action in a controller [ChildActionOnly] public ActionResult GetImage(int id) { var photo = _Db.Photozs.Single(p => p.PhotozId == id); string path = Server.MapPath("~/Photo"+photo.Url); fs = new FileStream(path, FileMode.Open); return new FileStreamResult(fs, photo.ContentType); } My razor view is : @model IEnumerable @{ ViewBag.Title = "Index"; }

    @foreach (var item in Model) {

    ![](@Url.Action()

    @item.Caption

    }

    The problem I'm having is that when I remove d ChildActionOnlyAttribute from GetImage action the image renders in the view but when I add it it does not. I want this action to b child so it cannot be invoked directly by the user. Thanks

    ASP.NET asp-net database sysadmin help question

  • Problem with foreach loop in MVC 3 Razor View
    S solomon201

    I have a loop in my razor view as below

    @foreach(var inmate in Model) { @inmate.inmateid @inmate.inmateid }

    My Model is an IEnumerable of inmates containing 2 inmate objects. But the result I am getting in my browser is 6 6 7 7 Instead of 6 7 Please can someone tell me why this is the case? Thanks

    ASP.NET asp-net architecture help question

  • Specifying Seed Values on model building
    S solomon201

    Is it possible to specify from the override of onmodelbuilding() the starting value to use for a table primary key and the seed value to use for generating the rest columns? I'm using 4.1 code first

    Database json question

  • Project Ideas
    S solomon201

    I will be doing my final year project later this year and i want to develop an application. Almost everybody is developing a website. I want to do something different something like a distributed system using Preferably WCF or TCP/IP sockets using C#. Please guyz i need ideas i could implement using these tools. Thanks

    C# csharp wcf tools

  • Database table creation error
    S solomon201

    I am using SQL Server 2008 R2 with C# running VS2010 The Code that gives the Error is this: StringBuilder sb = new StringBuilder(); try { sb.AppendLine(string.Format("Starting to create {0} with login to {1}", this.tbDBName.Text, this.tbBTSAppUser.Text)); sb.AppendLine("Connecting to DB Server"); this.tbProgress.Text = sb.ToString(); this.tbProgress.ScrollToCaret(); //Connect to the local, default instance of SQL Server. string srvname = this.cbServers.SelectedItem as string; Server srv; if (srvname == null) { srv = new Server(); sb.AppendLine("Connected to local SQL server"); } else { srv = new Server(srvname); sb.AppendLine(string.Format("Connected to {0}", srvname)); } this.tbProgress.Text = sb.ToString(); this.tbProgress.ScrollToCaret(); //Define a Database object variable by supplying the server and the database name arguments in the constructor. Database db = srv.Databases[this.tbDBName.Text.Trim()]; if (db != null) { if (MessageBox.Show(string.Format("The '{0}' already exists do you want to drop it?", this.tbDBName.Text), "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { db.Drop(); } else { if (MessageBox.Show(string.Format("Create the Tables and Stored Procedures for BT Error Manager on '{0}'?", this.tbDBName.Text), "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { sb.AppendLine("Creating the Tables and Stored Procedures."); this.tbProgress.Text = sb.ToString(); db.ExecuteNonQuery(dbstring); string ConnectionString = "Integrated Security=SSPI;" + sb.AppendLine(string.Format("Created the Tables and Stored Procedures for BT Error Manager on '{0}'", this.tbDBName.Text));

    Database database com help question

  • Database table creation error
    S solomon201

    I am trying to create a database and it's tables programmatically. I am following the Instructions from the link below but i keep getting this error ExecuteNonQuery failure. Please can someone look at the code? especially the table generation part because the Database creates but there are no tables in it.

    Create a SQL Database Programmatically[^]

    Database database com help question
  • Login

  • Don't have an account? Register

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