|
That would give you a number anywhere from 1 to 7 digits long. If you want the number to always be 8 digits, the min value should be 10000000, and the max should be 100000000.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi all,
I am very new in ASP.NET. Actually I code in vb.net and trying to make a database driven dynamic website.
I use to connect database through an XML file where I put the server, database name, user id and password. Then from a class I call these to connect the database. In this class I put the connectionstring which always read the data from the XML file like...
If (IO.File.Exists("db.xml")) Then
Dim DbXmlReader As XmlReader = New XmlTextReader("db.xml")
While DbXmlReader.Read
Dim DbNodeType = DbXmlReader.NodeType
If (DbNodeType = XmlNodeType.Element) Then
If (DbXmlReader.Name = "server") Then
srv = DbXmlReader.ReadInnerXml.ToString
End If
the above code is just a snippet.
Now my questions are...
1. Is the above method possible in ASP.NET to connect with a database ?
2. If not, then how should I connect with the database ?
3. Lastly, is there any good tutorial for beginners that how to create a database driven dynamic website from scratch in ASP.NET?
The tutorial should have all like add a template, adding css, database connection etc.
Thanks in advance.
|
|
|
|
|
Although it would be possible to read the connection details from a custom XML file, why not simply use the built-in support for configuring connection strings[^]?
web.config:
<configuration>
<connectionStrings>
<add
name="MyConnectionString"
providerName="System.Data.SqlClient"
connectionString="server=SERVER-NAME;database=DB-NAME;uid=USER-NAME;pwd=PASSWORD"
/>
</connectionStrings>
</configuration>
Code:
Imports System.Configuration
...
Dim connectionStringSettings As ConnectionStringSettings = ConfigurationManager.ConnectionStrings("MyConnectionString")
Using connection As New SqlConnection(connectionStringSettings.ConnectionString)
...
End Using
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard for your answer. Is there any good tutorial for beginners like me ?
|
|
|
|
|
Since you're just starting, and you don't have any legacy code to support, your best bet is probably to start with ASP.NET MVC. The ASP.NET site[^] has some decent introductory tutorials.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi to all
i want to read content of website using asp.net c# and store it to excel sheet.if any one have idea plzz suggest.
thanx in advance.
|
|
|
|
|
Google can get you very far...
C# Web Crawler[^]
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
|
5th place on Google!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Yeah But it gives nice documentation and easy also
Please up vote if it helped you
Thanks And Regards
Sibeesh
|
|
|
|
|
i am beginner of asp.net 4.0, need a perfect material to learn perfectly ,especially to create a website using visual studio 2010
|
|
|
|
|
visit below link if you are a true learner
https://www.youtube.com/user/kudvenkat
sumit
|
|
|
|
|
|
The best source to learn is http://www.pluralsight.com/training[^]
There are heaps of video tutorials goes each and every aspect of website development. This is I guess the perfect for any starter/beginner. You can even download the materials too. Then go to other tutorials and various sources on Internet. Only the cons of Pluralsight is that it is monthly subscription.
Other tutorials to learn:
http://www.w3schools.com[^]
http://www.codeproject.com[^]
www.asp.net/get-started[^]
Books(or Ebooks) are good, but they will consume lots of time. Rather start your early learning using Videos
|
|
|
|
|
|
How can I view mobile users of my ASP.NET Web application just like Facebook chat, and detect their geolocation or their location coordinates
modified 27-Jul-14 15:28pm.
|
|
|
|
|
Hi
if you are saying that you have a web application and a user open your web site on a mobile browser - and you want to track that user - then, you can follow the following:
- each request to your page from any browser will have headers associated with them which will tell you which device is the request from.
- you can use this 51degrees api to detect the mobile devices - http://51degrees.codeplex.com/[^]
- once you detect the device - you can perform your business logic
hope this helps.
Lohith
MVP (ASP.NET/IIS)
http://about.me/kashyapa
|
|
|
|
|
i am working on a project university management system.i want only principal have rights to generate id for teachers and hod's.hw cn i generate a system like this in asp.net
|
|
|
|
|
Not clear. Rephrase your question & update your question with sample example.
|
|
|
|
|
If you mean creating a network user account, then you should look at:
System.DirectoryServices
If you are running LDAP you would connect to the Active Directory with something like this ...
_de = New DirectoryEntry("LDAP://OU=xx,DC=yy,DC=yourcompany,DC=com", UserwithAdminRights, password)
Then create a new user from there. You would have to connect to the Active Directory with an account that has sufficient privilege to create users.
Hope this helps.
|
|
|
|
|
You have to write the code to do this.
1. You'll want some of way storing what a user's rights are. You could hard code that a principal has the rights but not a good idea.
2. You write code to block anyone without the permission.
You just have to write the code. There is no magic copy/paste code to do this.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
this sounds like a question about implementing asp.net membership / roles
in which case you can control access to functions by using membership / roles like this:
if (Roles.IsUserInRole(userName, role)){ //do your role specific stuff here}
|
|
|
|
|
In a small company, I am making small changes to a vb.net web forms 2010 application. There are no pervious directions on how to set up the deployment of the application. I have used the old version of deployment using msi packages that are not supported after asp.net 2010. I have not used web deployment yet. I set attached to this application that there is a web deployment project that was used.
Thus can you give me directions and/or point me to a url that will tell me how to setup a web deployment project that can be installed on an IIS server.
|
|
|
|
|
I don't think anybody uses web deployment any more, but I haven't taken a poll on the question.
That was a Server 2003 Thing, and IIS6 using meta compatibility or something. I don't remember anymore, but it was another one of those Microsoft things in which they tried to make ASP.NET / Server 2003 look more appealing by offering the deployment program, and then phased it out later on down the road.
I used it back in 2004/2007, then phased it out in 2008 when server 2008 was released. That was 6 years ago.
Speaking of IIS servers, IIS has come a long ways since IIS 5.5 and 6.0
Setting up a web site using web deployment on server 2008+ is a huge security risk.
Times have changed, server 2012 using hyper-visors and virtual servers are the in thing today.
Just copy the folder to the web server, and use the IIS Management console to setup a test website, and play around with it. Don't forget to set your folder permissions for the application pool user, set your bindings and you should be OK. If you need to write to the drive, set the trust level.
|
|
|
|
|
DISCLOSURE: I am not a web developer, but I've heard a lot of buzz words about web development
I have a client with small data needs for some very confidential information for his clients, which number around 3,500. For the past 20 years we have done everything on a small server located on-premises, to which only a handful of people have access. Much of the information we have been getting and storing has come from paper forms the clients complete and send in by snail mail, whereupon the data is keyed in to our WPF-based/SQL Server-backed system.
Times change and we now find it necessary to give his clients access to their own information via the web. They'll also be expected to provide updates via the web, rather than the paper forms of old. My client is paranoid about public web hosting and the thought of letting his data go off-site, but DOES NOT have the ability and/or resources to administer a web site locally on his own server.
So, down to the questions:
How feasible is it to use a public host for a web site to handle all the login/authorization stuff, and have that site retrieve the data from, and update the data on, our on-premises server?
How does one manage the tasks of 1) setting up several thousand users with secure login credentials, and 2) managing account lockouts/forgotten passwords/etc.?
What technologies would you advise using? ASP.Net & Azure, for example? What about SharePoint? Non-MS technologies?
What important questions am I not asking here?
Perhaps the biggest question: What important questions do I need to ask my client?
Thanks
|
|
|
|