|
|
Hey guys, I have searched about this on the new and here but I'm still confused, so I'm gonna lay out this and hopefully with your help I can get it over with.
I'm trying to design and implement a 3 layer web application,
I want to fetch the info(fields such as name, email, ... ) for a student from Student table in my database:
(consequently I want to do update, delete and insert as well)
In my DAL class I fetch the record from database and return a dataset:
public DataSetFetchProfile(string UserName)<br />
{ <br />
DataSet ThisDataSet = new DataSet();<br />
ThisAd.SelectCommand = new SqlCommand("Profile_FetchStudentInfo", ThisConnection);<br />
ThisAd.SelectCommand.CommandType = CommandType.StoredProcedure;<br />
ThisAd.SelectCommand.Parameters.Add("@UserName", SqlDbType.NVarChar, 256).Value = UserName;<br />
ThisAd.Fill(ThisDataSet, "StudentT");<br />
return ThisDataSet;<br />
}
and I have this function in my BLL class calling this one:
public DataSet ReturnProfileInfo(string UserName)<br />
{<br />
return ThisStudent.FetchProfile(UserName);<br />
}
There are two things I might do in my presentaion layer (webpage),
1- populate some text boxes (fields of the record which was fetched)
I use the following code:
foreach (DataRow row in ThisDataSet.Tables["StudentT"].Rows)<br />
{<br />
}
2- populate a grid view ( which is easy by assigning its datasourse to the dataset which was returned)
one thing is that the point of having 3 layered is not having any codes related to database, but I have to have a dataset in my page !
I have read a lot that this isn't such a good way of implementing 3 layer architecture, I'm working on my final project and I need something not too much confusing.
I would really appreciate it if you could send me a sample of redirect me to a page ( again as I mentioned before, I 'm looking for something less confusing and easy to implement), so I can finish it and also learn something.
Regards,
K
|
|
|
|
|
You've done the right thing, you can have dataset, datatable or class object (orm) in your page, otherwise you can implement your requirement! Let me ask you something, can you tell me what db you're using by looking at ds, dt or object? No, you can't because that's independent of actual database your ds,dt doesn't know from what type of db they're getting data.
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
Hi,
Can anybody tell me why microsoft office whould not be installed in our web servers , how the office dlls will affect our sites .
|
|
|
|
|
Then why you are not putting those dlls in Server from your client system ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
Thanq for your reply , I just heard that microsoft office should not be installed on the web servers , so wanted to know the reason.
|
|
|
|
|
Hi,
I'm facing an big issue. i have created an small project which is working good in normal environment.
but when it is going in cloud computing, events are not working properly.i have used datalist and itemcommand is used. but its not working.
Please help me as soon as possible. Its very urgent.
I'm waiting for reply.
Thnax in advance.
krishna veer singh
|
|
|
|
|
krishnaveer wrote: but when it is going in cloud computing, events are not working properly.i have used datalist and itemcommand is used. but its not working.
What do you mean by not working ? What environment do you have ?
krishnaveer wrote: Please help me as soon as possible. Its very urgent.
Merry Christmas !!
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Actually i have taken datalist inside datalist. Now on the page load i'm filling the datalist. first time its working fine. but when i click on a button inside datalist, now everything get disappear, means datalist is not loading again. This is happening in cloud computing environment.
But the same thing is working fine in normal .net hosting environment.
krishna veer singh
|
|
|
|
|
hii all,
i want to show the navigation path in my website like from which page the user navigated.
eg:home>>default1>>default2>>.....so on.can any body give me idea what shud i do.shud i maintain session or is there any other way....thank's
Regard's
parikshit
|
|
|
|
|
|
|
depends on your requirement. you can also bind the simple repeater at there.
it known as bread-cums.
Regards
Keyur Satyadev
|
|
|
|
|
you can do the path yourself in the page which you need to show to the user.
|
|
|
|
|
Is there a combobox in asp.net? I am using Visual Studio 2008 c# I have a Gridview that need a column more like a combobox then the Dropdownlist I can find.
I would like to display/edit a multi selection enumerated flags dropdown stored in a bit masked value.
for this column and row in the grid they can select multiple option. I have a checkboxlist to day, it work but will not collapse so the edit row or the insert row fill the whole grid. when I am an old roll comp sic new to this interment.
public DataTable FetchType()
{
DataTable dt = new DataTable("AppCode");
dt.Columns.Add("AppCode", typeof(int));
dt.Columns.Add("AppCodeName", typeof(string));
foreach (int index in Enum.GetValues(typeof(AppCode)))
{
if (Enum.GetName(typeof(AppCode), index).Substring(0,3) != "All")
dt.Rows.Add(index, Enum.GetName(typeof(AppCode), index));
}
return dt;
}
CheckBoxList TypeEdit = (CheckBoxList)e.Row.FindControl("TypeEdit");
if (TypeEdit != null)
{
TypeEdit.DataSource = patterns.FetchType();
TypeEdit.DataBind();
Int32 AppCode = Convert.ToInt32(PatternGV.DataKeys[e.Row.RowIndex].Values[2].ToString());
foreach (ListItem currentCheckBox in TypeEdit.Items)
{
if ((Convert.ToInt32(currentCheckBox.Value) & AppCode) > 0)
currentCheckBox.Selected = true;
}
}
Where’s the Truth
|
|
|
|
|
Bob From Accountemps wrote: Is there a combobox in asp.net? I am using Visual Studio 2008 c# I have a Gridview that need a column more like a combobox then the Dropdownlist I can find.
You can use gridview Template Field to put an dropdown list inside it
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
This site is very cool the Maintain GridView Scroll Position and Header Freez where something I needed, but I don’t see or couldn’t find the anything on a combobox in a gridview
Thanks
Where’s the Truth
|
|
|
|
|
hi, I have two MVC applications. I go to the MVC2 application from MVC1 application, I pass a token. When the MVC2 applications is loaded, its fetch the token and create the session. There are two button Logout and Save. I open MVC2 application in a IE browser and open the same application on the another tab. I just click the Logout button, which deletes all the sessions of the MVC2 application. Then I go to the first tab and click on the save button. Before saving the data, I simply check whether the session is exist or not, If session is exist then it will save the data otherwise redirect to the MVC1 application. But when I click on the Save button its shows the error "This page is accessing information that is not under its control. This proses a security risk. Do you want to continue?"
I have used following code to check the session in the save button
btnSave.bind("click", function(event) {
isSessionActive();
SaveData()
}
function isSessionActive() {
$.ajax({
url: "http://localhost/Home/IsSessionActive",
type: "POST",
data: {},
success: function(result) {
if (result !== "True") {
window.location = "http://MVC1/Home";
}
}
});
}
The server side code of IsSessionActive is
public bool IsSessionActive()<br />
{<br />
if (Session == null || Session["AuthorizedToken"] == null)<br />
{<br />
return false;<br />
}<br />
<br />
return true;<br />
}
I have also put the debugger point in the IsSessionActive function, but after logout it does not debug. It show the same message. Does anyone have any idea, how to resolve this problem.
Pankaj
|
|
|
|
|
hi alll
i've been searching on the net and no one gave me what i want, i need a popup calendar in my page andi want it to return the value of the selected date into a textbox...
could it be done without (page load), i tryed doing it in javascript and i managed to open but cant find a way to return a value from the calendar?????
|
|
|
|
|
use ajax control calentdar.
you can get it from here.
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx
Regards
Keyur Satyadev
|
|
|
|
|
|
still no luck,
i have the following code :-
function Calender()
{
var date = document.getElementById("ctl00_ContentPlaceHolder1_tbDateOfBirth").value;
var cal = window.showModalDialog('Calender.aspx', date, 'resizable:off;dialogheight:250px;dialogwidth:360px');
document.getElementById("ctl00_ContentPlaceHolder1_tbDateOfBirth").value = cal;
}
now on child page i added (var read = window.dialogarguments;) but know i dont know how to take value from calender and return it back....
someone help
|
|
|
|
|
whay you are not using the ajax control toolkit and calendar control of it. just you have to write 3 lines that enough. you don't have to make any coding.
Regards
Keyur Satyadev
|
|
|
|
|
how, am new at all this, and am trying to have knowledge about this so can u help
??
|
|
|
|
|
sorry for let response as i was left the office.
download the ajax control toolkit and give referenct it into your project.
put this line in aspx page at 2 line
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
now simillar to <asp:Label> you will get the <cc1:CalendarExtender> .
for details of using you can also refer my previous reply and you will get that how to use it.
its very simple.
hope this is fine for you.
let me know if you have ant doubts still.
Regards
Keyur Satyadev
|
|
|
|