|
Very Bad Practise that is Vulnerable to SQL injection. i dont know why dont you let SQL do the SQL and ASP.nET do the ASP.NET PArt.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Of course its possible, all you are doing is reading a file - just make sure its located in an accessible directory. take a look at the SYSTEM.IO namespace.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
souravghosh18 wrote: store all the queries in a text file
How about storing them in the database, like as Stored Procedures
only two letters away from being an asset
|
|
|
|
|
This is the code for the login.aspx
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="_Default" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:LoginView ID="LoginView3" runat="server">
<LoggedInTemplate>
Welcome back.
</LoggedInTemplate>
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8"
BorderPadding="4" BorderStyle="Solid" BorderWidth="1px"
DestinationPageUrl="~/Login.aspx" Font-Names="Verdana" Font-Size="0.8em"
ForeColor="#333333">
<TextBoxStyle Font-Size="0.8em" />
<LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" />
<InstructionTextStyle Font-Italic="True" ForeColor="Black" />
<TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em"
ForeColor="White" />
</asp:Login>
</AnonymousTemplate>
</asp:LoginView>
</asp:Content>
And the name of the database created by the security in ASP.NET is ASPNETDB.MDF
|
|
|
|
|
Merge The Database(security) to Your Using Database and Change the Connection String of aspnetdb by default( ) In Web.config file .If This Is not ur Answer Sorry..!
If It Helps Click It as Answer
|
|
|
|
|
You can re-create the schema for the ASPNETDB in your own database and then specify your database in the connectionstring in your web.config.
To create the schema in your own DB go to command prompt and go to c:\Windows\Microsoft.NET\Framework\v2.0.50727. When you are at this directory type aspnet_regsql and hit enter. A window will show a wizzard that will take you through the steps of selecting your database and then it will create the schema for you.
All you have to do now is add a connectionstring to your web.config file that points to this database.
Now that you know where the database resides, you can now proceed to move it to the host server where you want to deploy it. The most effective way for me is to right click the database in SQL explorer and select Generate Script.
When you have the script you can just ask one of the admin guys at your hosting company to run and attach the db and you are all done!
Enjoy!
Illegal Operation
|
|
|
|
|
Hi
I need to create a webpage which inputs an url which the web page would process and provide some result to the user.
Sending an HTTP Request from my server to any other server and getting the response - this is where I need help.
Sample code or which ASP.Net classes to use would sufficiently be of great help.
Thanks in Advance
Sean
|
|
|
|
|
Sean Cleetus wrote: Sending an HTTP Request from my server to any other server and getting the response
They Should also Give Response To Ur Server If thts the Case Then Ok
If U R Working With Third Party Then They Have A interface /Or the Coding Methods to Follow
The Below Code Was Used By Me For Credit card Authentication Which Innvolves Both
IT May Help..!
private string CreditCardCheck(decimal bidamount)
{
string relayResponse = GeneralSettings.CreditCardRelayResponse;
string creditCardTestRequest = GeneralSettings.CreditCardTestRequest;
string creditCardDelimData = GeneralSettings.CreditCardDelimData;
string TrasactionId = "";
String result = "";
string expDate = "";
expDate = DropDownMonth.SelectedItem.Text + DropDownYear.SelectedItem.Text;
String strPost = "x_login=" + loginID + "&x_tran_key=" + trans_Key + "&x_method=CC&x_type=AUTH_ONLY&x_amount=" + bidamount + "&x_delim_data=" + creditCardDelimData + "&x_delim_char=|&x_relay_response=" + relayResponse + "&x_card_num=" + TextBoxCreditCardNo.Text + "&x_exp_date=" + expDate + "&x_test_request=" + creditCardTestRequest + "&x_version=3.1" + "&x_first_name=" + TextBoxCardholder.Text + "&x_last_name=" + TextBoxCardholderLastName.Text + "&x_company=" + TextBoxCompany.Text + "&x_address=" + TextBoxAddress.Text + "&x_city=" + TextBoxCity.Text + "&x_state=" + StatesDropDownlist.SelectedItem.Text + "&x_zip=" + TextBoxZipCode.Text + "&x_country=" + TextBoxCountry.Text + "&x_phone=" + TextBoxPhone.Text + "&x_fax=" + TextBoxFaxl.Text + "&x_email=" + TextBoxEMail.Text;
StreamWriter myWriter = null;
string url ="https://secure.authorize.net/gateway/transact.dll";
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Method = "POST";
objRequest.ContentLength = strPost.Length;
objRequest.ContentType = "application/x-www-form-urlencoded";
try
{
myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(strPost);
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
finally
{
myWriter.Close();
}
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr =
new StreamReader(objResponse.GetResponseStream()))
{
result = sr.ReadToEnd();
string[] responsedetails = result.Split('|');
TrasactionId = responsedetails[6].ToString();
sr.Close();
}
if (result.ToLower().Contains("invalid") || result.ToLower().Contains("inactive"))
{
return "CreditCardis notvalid";
}
return TrasactionId ;
}
If It Helps Click It as Answer
|
|
|
|
|
Thanks you very much Sashidhar. This is exactly what I was looking/hoping for
|
|
|
|
|
Its Ok ..! Any Time..!
If It Helps Click It as Answer
|
|
|
|
|
I appreciate your effort. But few things to consider while replying,
1) Post only relevant code. The code posted by you has a lot of unwanted stuff.
2) Avoid using SMS language[^]. It is hard to read.
|
|
|
|
|
Ok Thx For Ur Suggestion I will Do From Next Time..!
If It Helps Click It as Answer
modified on Wednesday, September 23, 2009 7:37 AM
|
|
|
|
|
Most easy way to get a response from a URI is to use WebClient[^] class.
|
|
|
|
|
In perticular date the main report have record but subreport have no record.In this situation the subreport retrieve all the data from table.
How to supress sub report when this situation. Please help me..........
|
|
|
|
|
I think Here U Will Not Get Most Help For reports Questions I suggest U to Post In General DataBase Or Different Forums .I am Telling U this With My Own Experience..!
If It Helps Click It as Answer
|
|
|
|
|
Can Any One expain the dis advantaged of LINQ,like where i Can use and where I can not...
Thanks,
Srinivas Mateti
|
|
|
|
|
Disadvantages of LINQ over Stored Procedures
-----------------------------------------------
1) Network traffic: sprocs need only serialize sproc-name and argument data over the wire while LINQ sends the entire query. This can get really bad if the queries are very complex. However, LINQ's abstraction allows Microsoft to improve this over time.
2) Less flexible: Sprocs can take full advantage of a database's featureset. LINQ tends to be more generic in it's support. This is common in any kind of language abstraction (e.g. C# vs assembler).
3) Recompiling: If you need to make changes to the way you do data access, you need to recompile, version, and redeploy your assembly. Sprocs can sometimes allow a DBA to tune the data access routine without a need to redeploy anything.
|
|
|
|
|
S.Dhanasekaran wrote: Disadvantages of LINQ over Stored Procedures
How a comparison is possible between LINQ and Stored Procedures?
|
|
|
|
|
sris 426 wrote: Can Any One expain the dis advantaged of LINQ
In ASP.Net Forum?
I would have chosen LINQ [^]forum forum for that
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I dont want my Data Layer to Contain SQL Manupilation. Linq does that. I like Linq to Object. Am not a Fan of Linq to SQL
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
What About LINQ to XML and other options? I am using linq to load and process XML file? Will it give any extra burden to Application. Please advise.....
Thanks in advance
Srinivas Mateti
|
|
|
|
|
Anyhow, you are somewhat comparing apples and oranges. LINQ to XML (and LINQ in general) is a query language whereas XSLT is a programming language to transform XML tree structures. These are different concepts. You would use a query language whenever you want to extract a certain specific piece of information from a data source to do whatever you need to do with it (be it to set fields in a C# object). A transformation, in contrast, would be useful to convert one XML representation of your data into another XML representation.
So if your aim is to create C# objects from XML, you probably don't want to use XSLT but any of the other technologies offered by the .NET Framework to process XML data: the old XmlDocument, XmlReader, XPathDocument, XmlSerializer or XDocument. Each has it's special advantages and disadvantages, depending on input size, input complexity, desired output etc.
|
|
|
|
|
Vuyiswa Maseko wrote: I dont want my Data Layer to Contain SQL Manupilation.
So what does your data layer contain?
only two letters away from being an asset
|
|
|
|
|
In my Data Layer i call the SP that does the Necessary manupilation. What i mean is that you will never Find select statements in my Data Layer.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hello!
I'm kinda new to ASP.net so i am just testing and failing, so maybe the approach i am going for is just wrong if so tell me =)
I'm trying to print a sequence of HTML code with Response.Write ... works fine enough, but i am interested in printing this code at a specific point on the page...
Currently i am trying to do that from the class with the method Page_Load, with the event of a button click...
Don't know if that explain it..
|
|
|
|