Tag: asp.net

Set up an object so I don't have to edit it on SQL Server and VB.net project?

Currently, I have the following setup for my objects to interact with SQL Server database. I would like to simplify this process so that I can be more efficient with writing my project. In Rails I am able to run a generator and it adds/edits the database, connectors, and model files. I find it is […]

How to assign Datatypes for the DropDownList bounded with List of Items

I have a DropDownList bounded with List of Items from the SqlDatasource. The List of Items in the DropDownList are bounded based on the following query SELECT COLUMN_NAMES FROM INFORMATION_SCHEMA.COLUMNS WHERE (TABLE_NAME = ‘RESULT’) My Requirement: How to assign Multiple Datatypes for those DropDownList Items i.e. Few indexes in the List of Items shall be […]

Logging in to SQL Server using SQL logins with ASP.NET MVC

I am writing a small addon mobile app to an existing applications database, the application stores login details through SQL Server logins: I want to be able to use these existing logins (and permissions if possible) in my mobile web app but I can’t find if there is an easy way to do this. I […]

Cascading dropdown using Case Statement in SQL

I have front end application that users my select either City name from drop down box or State name from another drop down box. If users select ALL from the State drop down then the query should return all the States and the same thing is true for the City. The table has other info […]

ASP.NET VB How to add value from one column into multiple series of line chart

I want to ask about line chart series in vb.net. I have a line chart that has two series. I want to add data into each series from the same column database with a condition. my table in the database: Date##### | Value1 | Value2 | Value3 | Type 23/04/2014 | 1,2 | 12,3 | […]

Capture xml from an api call and write to database table using sqlxmlbulkload

I’m wanting to capture xml returned from an api call and write this directly to an SQLserver table using SQLXMLBulkLoad. So far, I’m able to caprture the xml and write it to a file, I then use SQLXMLBulkLoad to read the file and load it into a table in SQLServer. This works but saving to […]

Dont want to show Id of data in grid

I am trying to display table data on grid but I d’ont want to display table Id. I also kept ApplyFormatInEditMode=”True” If I do datafield visible= false. It does not work with edit command. How to hide Id from Grid. Here is my code. <%@ Page Title=”” Language=”C#” MasterPageFile=”~/MasterPage.master” AutoEventWireup=”true” CodeFile=”EditExpenses.aspx.cs” Inherits=”EditExpenses” %> Edit Expenses […]

Retrieve image from SQLSERVER database using webservice without handlers?

I want to know is there any method to retrieve image from SqlServer without using handlers in web services[Asp.net]? I am currently using this code In my webservice.cs file public class WebService : System.Web.Services.WebService { SqlConnection con = new SqlConnection(); public WebService () { con.ConnectionString = ConfigurationManager.ConnectionStrings[“cn”].ConnectionString; if (con.State == ConnectionState.Closed) { con.Open(); } //Uncomment […]

Pass null to integer in SQL Server from ASP.NET

DataTable dt = new DataTable(); dt=//Calling SP which will return a datatable dt.Rows[i][“requestid”] = System.DBNull.Value; // Problem here I also tried System.Data.SqlTypes.SqlInt32.Null but without success. I get an error: Object cannot be cast from DBNull to other types. Please help me out of this.

Microsoft Sync framework delete not working

I have implemented synchronize between SQL server 2008 and SQL Compact database with two way. It is perfectly working with insert and update data in database and synced very well. But if I try to delete a record from one database like sql server after that i synced with sql compact it is come back […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.