Click here to Skip to main content
16,006,440 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: Dialogue box Pin
indian14319-Mar-08 17:47
indian14319-Mar-08 17:47 
GeneralRe: Dialogue box Pin
Christian Graus18-Mar-08 23:41
protectorChristian Graus18-Mar-08 23:41 
GeneralRe: Dialogue box Pin
indian14320-Mar-08 10:01
indian14320-Mar-08 10:01 
QuestionBind dataset to OWC pivot table Pin
Kavitha Shetty18-Mar-08 21:16
Kavitha Shetty18-Mar-08 21:16 
Generalfckeditor line spacing Pin
meghamaharshi18-Mar-08 21:11
meghamaharshi18-Mar-08 21:11 
GeneralAdding row from datagrid to another datagrid in asp.net using C#.Net Pin
attalurisubbu18-Mar-08 21:00
attalurisubbu18-Mar-08 21:00 
GeneralRe: Adding row from datagrid to another datagrid in asp.net using C#.Net Pin
N a v a n e e t h18-Mar-08 21:19
N a v a n e e t h18-Mar-08 21:19 
Generalquestion about BLL and DAL and UI Pin
uglyeyes18-Mar-08 20:47
uglyeyes18-Mar-08 20:47 
Hi!

I have a project made up of asp.net website (2008) and a class library project.
my class library project is a DAL which is accessed via BLL that is in asp.net website.
DAL is made up of several tableadapters in a dataset.

I need to dynamically change connection properties of tableadapters in DAL if change is made in web.config file in asp.net website. I am just not sure how could i achieve this.

my BLL (which is not working currently)
------
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using myDAL.DAL;


[System.ComponentModel.DataObject]
public class EmployeesBLL
{
private myDAL.DAL.dsEmployeeTableAdapters.getEmployeeTableAdapter empTableAdapter = null;

private string ConnString
{
get
{
string conn=null;
return conn = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["db1ConnectionString"].ConnectionString;
Console.WriteLine(conn);


}
}

protected myDAL.DAL.dsEmployeeTableAdapters.getEmployeeTableAdapter Adapter
{
get
{
if (empTableAdapter == null)
empTableAdapter = new myDAL.DAL.dsEmployeeTableAdapters.getEmployeeTableAdapter();

return empTableAdapter;
}
}

[System.ComponentModel.DataObjectMethodAttribute
(System.ComponentModel.DataObjectMethodType.Select, true)]
public dsEmployee.getEmployeeDataTable GetEmployees()
{
return Adapter.GetEmployee ();
}
}
------


my DAL ( not sure if i am doing this correctly)
----
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;




namespace myDAL
{

public partial class Employee
{

public DataTable getEmp(string ConnectionString)
{
SqlConnection conn =null ;
try
{
conn = new SqlConnection(ConnectionString);

DataTable dt = new DataTable();
DAL.dsEmployeeTableAdapters.getEmployeeTableAdapter eta = new myDAL.DAL.dsEmployeeTableAdapters.getEmployeeTableAdapter();
eta.Connection.ConnectionString = conn.ToString();
dt = eta.GetEmployee();
return dt;

}

catch (Exception ex)
{
Console.Write("Error in connection : " + ex.Message);
return new DataTable();
}
finally
{
conn.Close();

}
}

}
}


asp.net website aspx page

<asp:GridView ID="gvEmployee" runat="server" AutoGenerateColumns="False"
DataSourceID="ObjectDataSource1">
<Columns>
<asp:BoundField DataField="employeeid" HeaderText="employeeid"
InsertVisible="False" ReadOnly="True" SortExpression="employeeid" />
<asp:BoundField DataField="loginid" HeaderText="loginid"
SortExpression="loginid" />
<asp:BoundField DataField="title" HeaderText="title" SortExpression="title" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetEmployees"
TypeName="EmployeesBLL"></asp:ObjectDataSource>


please help
GeneralRe: question about BLL and DAL and UI Pin
N a v a n e e t h18-Mar-08 21:00
N a v a n e e t h18-Mar-08 21:00 
GeneralMsgBox In Web Applications Pin
Member 471741218-Mar-08 20:29
Member 471741218-Mar-08 20:29 
GeneralRe: MsgBox In Web Applications Pin
Christian Graus18-Mar-08 20:30
protectorChristian Graus18-Mar-08 20:30 
GeneralRe: MsgBox In Web Applications Pin
Member 471741218-Mar-08 23:15
Member 471741218-Mar-08 23:15 
GeneralRe: MsgBox In Web Applications Pin
Christian Graus18-Mar-08 23:54
protectorChristian Graus18-Mar-08 23:54 
GeneralRe: MsgBox In Web Applications Pin
Laddie18-Mar-08 22:33
Laddie18-Mar-08 22:33 
GeneralRe: MsgBox In Web Applications Pin
Member 471741219-Mar-08 22:34
Member 471741219-Mar-08 22:34 
GeneralRe: MsgBox In Web Applications Pin
indian14320-Mar-08 10:16
indian14320-Mar-08 10:16 
GeneralRe: MsgBox In Web Applications Pin
sandep sharma20-Mar-08 20:05
sandep sharma20-Mar-08 20:05 
Questionhow to rotate images using Ad-Rotator control in ASP.NET Pin
vinifrednathan18-Mar-08 20:24
vinifrednathan18-Mar-08 20:24 
GeneralRe: how to rotate images using Ad-Rotator control in ASP.NET Pin
Christian Graus18-Mar-08 20:29
protectorChristian Graus18-Mar-08 20:29 
GeneralRe: how to rotate images using Ad-Rotator control in ASP.NET Pin
indian14320-Mar-08 10:19
indian14320-Mar-08 10:19 
GeneralServer Error in '/' Application. Pin
zeeShan anSari18-Mar-08 20:17
zeeShan anSari18-Mar-08 20:17 
GeneralRe: Server Error in '/' Application. Pin
N a v a n e e t h18-Mar-08 20:22
N a v a n e e t h18-Mar-08 20:22 
QuestionRe: Server Error in '/' Application. Pin
zeeShan anSari18-Mar-08 20:49
zeeShan anSari18-Mar-08 20:49 
GeneralRe: Server Error in '/' Application. Pin
N a v a n e e t h18-Mar-08 20:56
N a v a n e e t h18-Mar-08 20:56 
GeneralRe: Server Error in '/' Application. Pin
zeeShan anSari18-Mar-08 21:08
zeeShan anSari18-Mar-08 21:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.