I want to execute a SQL Server stored procedure using C#. This is my current code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBCon;
using System.Data;
using System.Data.SqlClient;
public class LoginDAl
{
public static DataSet login_vald()
{
DBConnect myConnection = new DBConnect();
SqlCommand comm = new SqlCommand("ph.validate_app_user", myConnection.connection);
comm.CommandType = CommandType.StoredProcedure;
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
}
}
This is a dummy project for practice. Are DLLs the standard for DALs? This is a desktop application.
This a part of the DAL.
The error is
login_vald()- not all code paths return a value
The error is quite clear:
…means that your function is missing a
returnstatement with an object of typeDataSetsomething like: