|
Hi
I would advise that you write the data access layer by using the repository pattern. It should return each object/record from the database as it is in the database. The business logic layer will use these repositories to perform crud operations.
The business layer should contain all the business rules for accessing/restricting data, validations etc.
This layer is best implemented with view models(DTO objects) created on it as you might know the data you store in a database might not necessarily the same as it comes from the UI. The presentation layer will use these DTO objects to pass data to the business layer. Hope this makes sense.
|
|
|
|
|
HI,
I want to ask a question regarding DropDownList.
This is the code:-
<asp:dropdownlist id="DropDownList1" runat="server"
="" onselectedindexchanged="DropDownList1_SelectedIndexChanged" height="22px" width="77px" autopostback="True">
<asp:listitem>+54 Argentina
<asp:listitem>+93 Afganistan
<asp:listitem selected="True">+91 India
<asp:listitem>+61 Austrila
<asp:listitem>+91 India
<asp:listitem>+32 Belgium
<asp:listitem>+91 India
<asp:listitem>+53 Brazil
<asp:listitem>+359 Bulgaria
<asp:listitem>+86 China
<asp:listitem>+299 GreenLand
<asp:listitem>+33 France
<asp:listitem>+49 Germany
<asp:listitem>+852 HongKong
<asp:listitem>+52 Mexico
So, I want if user select +33 France from DropDownList then in DropDownList it should display +33 FR instead of this full name +33 France which is mention in DropDownList???So,is it possible??? How can I achieve this???
|
|
|
|
|
You can see DisplayText set to your control here it is "+33 France" and what you have selected. However, you can have different Value returned for your selection you made.
If you want to see the different text before and after selection for the same control you can't.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
What you are trying to do is not a good practice. Why do you want to change the dropdown list after user selected it. Are you making things harder while there might an easier solution for you actually need ???
|
|
|
|
|
hello
h have a problem in opening the html page of my website with / at the end of url
for example when i open the below page without / at the end of url,the page open corrctly but when i put the / at the end of url,the page didn't open
example url :
correct address : [open correctly]
incorrect url : [open incorrectly]
please help me
|
|
|
|
|
When clicked on above both URLS it opens correctly. What exact issue you are facing?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
Hi,
I am after some guidance how to incorporate angularjs into this project. I am looking for a nicer way of writing the data to the table. Any help would be most appreciated.
public class RaceDayDisplayController : ApiControllerWithHub<RaceDayDisplayHub>
{
[HttpPost]
[Route("api/DoSomething")]
public HttpResponseMessage DoSomething(Rootobject model)
{
Hub.Clients.All.LastSectional(model.sectionTimes[0].runners);
}
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Display</title>
</head>
<body>
<h2>Real-Time Raceday Data</h2>
<table id="showData"></table>
<!--
<!--
<script src="/Scripts/angular.js"></script>
<!--
<script src="/Scripts/jquery-1.10.2.min.js"></script>
<!--
<script src="/Scripts/jquery.signalR-2.1.2.js"></script>
<!--
<script src="/signalr/hubs"></script>
<script type="text/javascript">
$(function () {
var myHub = $.connection.raceDayDisplayHub;
try {
$.connection.hub.start();
myHub.on('LastSectional', function (runners) {
$("#showData tr").remove();
$('#showData').append('<tr><td width="150">Pos</td><td width="210">Name</td><td width="150">Margin</td><td width="150">Last Sectional</td><td width="150">Cumulative Times</td></tr>');
for (var i = 0; i < runners.length; i++) {
$('#showData').append('<tr><td>' + runners[i].position + '</td><td>' + runners[i].bookNumber + ' ' + runners[i].name + '</td><td>' + runners[i].margin + '</td><td>' + runners[i].sTime + '</td><td>' + runners[i].cumTime + '</td></tr>');
}
});
} catch (e) {
alert(e.message);
}
});
</script>
</body>
</html>
|
|
|
|
|
Hi All,
I have an ASP.Net Web Form Application and I have a button called "Open Cash Drawer" in the form, and I want when click the button call a windows form application on the client PC to open the cash drawer.
I do some search on the Internet and the result is to use "Register URI Scheme" to interact web and windows application together .
Please let me know how to do that, and give me any sample code if possible.
Thanks Alot
|
|
|
|
|
True, that is the only possible solution here.
Also, apart from that, you also need to make sure that your desktop application is also available on the client device, installed and listening for that URL or URI, or the protocol — you can check how Torrent clients, Skype client etc work. They use the same methods to listen to a button click, and then the browser itself starts the default application for that URL (uTorrent for the magnet links, Skype for call links, your email client for mailto links etc). This article covers everything you need to do in order to register that URI in the registry, Registering an Application to a URI Scheme (Windows).
Rest of the stuff is not at all complex, the only thing is to have the client install your desktop application, if they trust you, they will, if they do not then you need to earn some trust.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Could someone please explain what is happening in the following code?
Private Sub BindListView()
Dim constr As String = ConfigurationManager.ConnectionStrings("Tokens4UDissertationSite").ConnectionString
Using con As New SqlConnection(constr)
Using cmd As New SqlCommand()
cmd.CommandText = "SELECT ProductID, ProductName, ProductDescription, ProdImage, CustomerID, Cost FROM Product ORDER BY ProductID DESC"
cmd.Connection = con
Using sda As New SqlDataAdapter(cmd)
Dim dt As New DataTable()
sda.Fill(dt)
ListView2.DataSource = dt
ListView2.DataBind()
End Using
End Using
End Using
End Sub
|
|
|
|
|
That one is a simple code, that connects to a database and reads the records, to show them in a listview.
A few things to understand here include,
1) SqlConnection
2) DataTable
3) ListView
If you can understand this, and have a basic understanding of how a database works, then you would easily get to the point where you can know what this program is doing. Secondly, if you ever stumble upon such a problem, always try to Google for the objects provided here, such as, SqlConnection etc. Google would provide you with some useful information about them, through MSDN, or through any other popular channel.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
+5. Great explanation.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Post an accurate Subject next time please.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello, please someone help me how to do this exercise step by step.
Regards
Exercise – ASP.NET MVC Web Application
Create an ASP.NET MVC web application to display customer orders.
You must use the Model-View-Controller design pattern using Visual Studio 20115 and C# .NET.
For the UI, create two Views and the necessary Controllers that return the Views; one View for showing customer information and the other for showing the orders.
The orders View should be the default View that displays all the fields related to the customer order, see the order table below but remember to show the customer name rather than the CustomerId.
For the customer Views, create 4 Views to Create, Read, Update and Delete all fields for a customer.
The model must contain the following two entities, whose data is persisted to a SQL Server database or file. CustomerId is the filed that links to order table with the Id field of the customer table
SCREEN HOW TABLES MUST BE:
http://store.picbg.net/pubpic/BA/18/c70ae946b178ba18.jpg
modified 16-Apr-17 2:56am.
|
|
|
|
|
Moni Shakeera wrote: You must I think that is clear enough. No one here is going to do your work for you.
|
|
|
|
|
Moni Shakeera wrote: please someone help me how to do this exercise step by step. Sure. What do you need?
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi,
I want to develop an ASP.Net Application (Financial and Accounting System), and this application must connect to many devices that connected to the client PC such as Cash-Drawer, POS Printer, Checks Reader, Scanners, and any device that can be used for this system.
My Question is: is it possible to deal and connect with all of this devices using the asp.net classic web form application.
Or to do the best I must create the application as a windows Forms Application.
Thanks a lot
|
|
|
|
|
A windows form will generally have more rights to access the local pc than a web app will so that would likely be better, in my opinion.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thank you, do you know any library that we can use it to connect to this devices or how to do this.
Thank You
|
|
|
|
|
I don't. Each device will have it's own way of communicating. Not sure if there is any library to help with that.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
<asp:requiredfieldvalidator id="ldValidator" runat="server" text="Please enter your cardnum1"
="" errormessage="Please enter your cardnum2" controltovalidate="CTextBox" display="Dynamic" enableclientscript="False">
<asp:regularexpressionvalidator id="RExpValidator" runat="server" controltovalidate="CTextBox"
="" errormessage="Please enter your cardnum3" validationexpression="^[0-9]{16,19}$" text="Please enter your cardnum4" display="Dynamic" enableclientscript="False">
<asp:customvalidator id="CreditCardNumberValidator" controltovalidate="CTextBox"
="" errormessage="Incorrect credit card number" text="Incorrect name" display="Dynamic" runat="server">
<asp:textbox id="CTextBox" class="text" size="40" maxlength="19"
="" runat="server">
<asp:button id="SubmitSecureOrder" onkeypress="SubmitOrder" alternatetext="Continue" runat="server" causesvalidation="true">
|
|
|
|
|
You have already posted this question in ASPNET forum.
You have applied regular expression validator to validate CARD Number which looks to be working. When you check did you input correct card number satisfying your regular expression? If not you will get the error even though you input 'Anything' not satisfying regular expression.
I tried something random number as ='9656385485477444' and did not get any issue
modified 20-Sep-20 21:01pm.
|
|
|
|
|
suppose i am working with SSMS and issuing many sql but sql server profiler will show all sql hiting database. so tell me how to configure sql server profiler to see my issued sql only.
suppose i have developed c# apps which calling store proc or issuing in line sql. so tell me in this scenario how could i configure sql profiler to see what sql my desktop application is issuing ?
guide me in details or get me a article link which help me to configure sql server profiler to see sql issued by my desktop apps.
thanks
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: guide me in details or get me a article link Please do your own research: that is what Google is there for.
|
|
|
|
|
You can filter the results. MSDN has a list of the columns and their use
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|