|
Hi,
I've been assigned a new project - online shopping website for a shop that sells TVs, music systems etc..
I've to start from scratch and I've no prior experience working with such an application. What I've to use is MIGS (Mastercard Internet Gateway Service) coz thats what the bank here support.
Where do I start from? I was hoping to use Dotnetnuke but it does not have any built-in or custom modules that supports MIGS. Nobody in my team has any experience in such a project, still we have to do this website coz this is for our group company!
Could anyone guide me how to go about laying a foundation for this, like where to refer for starting designing the database and application?
Regards,
Manu
“The thing for you is a burial permit. You have only to speak and I will see that you get it.”
|
|
|
|
|
Hi all,
I have to use MYSQL Database server as beckend for asp.net 2.0 web application. i have downlaoded and installed the MYSQL on my development machine(windows XP) and also downlaoded MYSQL Administrator for ease.
what are the remaining things which are essentail for connection asp.net 2.0 with MYSQL Database .
Best Regards
Rameez
|
|
|
|
|
You need to install ODBC connection drivers 3.1 ( i guess) for connecting. And you will be ready to go.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
MySql connector .NET[^]. It contains ADO.NET classes which can be used to connect with MySql. Using ODBC is not a good idea. ODBC adds and extra layer to the communication and will be slow.
|
|
|
|
|
Hey Guys,
I'me having a difficult time with a Menu control which is bound to a site map. We have a website where we allow the user to go along several paths via different instances of the browser, while logged in with a single session. To get around this we pass a single querystring value around to identify where each window is, a transaction id for instance. I'm having a difficult time figuring out how to append that dynamic querystring value value to the end of the navigation url attached to each menu item of a sitemap bound menu control.
We tried just some basic tests of hooking up the onprerender event and using something like this:
menuItem.NavigateUrl += "?Test =" + Request.QueryString["Test"];
But the query string object doesn't seem to survive multiple post backs.
Any ideas would be greatly appreciated,
Thanks,
Ryan
|
|
|
|
|
I have a Table.It is containing 4 column RegionID, MapFillColor, MapLineColor, MapCoordinates.
I want to run insert statement if the record is new when button press. But if the record already exist it should update the record REGIONID is primary Key in my Table. I donot know where i should put my function which check first the record exist if so then run update else insert statement.
Here is my Code
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data Source=ZAFAR-PC\\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("Insert into Region(RegionID,MapFillColor, MapLineColor, MapCoordinates) values( '" + RegionID_txt + "','" + MapFillColor_txt + "','" + MapLineColor_txt + "','" + MapCoordinates_txt + "')", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
|
|
|
|
|
Check it just above your insert statement.
|
|
|
|
|
Check for RegionId.
if (RegionId == "")
// then Insert
else
// Update.
Or if you can't get region Id, check the entry exists in database first. Like
if (RecordExists) // RecordExist is a boolean function which return true or false.
// then Update
else
// Insert
protected bool RecordExists()
{
bool retvalue = false;
// Write the queries which returns the result set
// If ResultantDataSet contains rows
retvalue = true;
else
retvalue = false;
return retvalue;
}
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
This should really be done in the SQL server using SP's..else you leave your server open to all manner of attacks..
Then you can also do the check in the sp and if exists update rather then insert
|
|
|
|
|
Thank you for reading this post. I am new to Javascript and ASP.NET development so please bear with me. I have a page that renders fine in IE but the same functionality gives me error in Firefox. I have a form which has a bunch of check boxes and there is a a particular checkbox lets call it ABC, and clicking on it, it needs to uncheck the other boxes, and if other check box is clicked, it shud uncheck the the ABC checkbox. The checkbox are created dynamically through code in a table cell. My app works fine in IE but not in Firefox. I know there are a few keywords that is Microsoft proprietary, and is not all browser friendly, but i cannot figure out how to change it. Here is my code below. All help is appreciated. the error I get in Firefox and Safari when I click on any checkbox is ctrl.ParentElement has no properties. All help and code sample/corrections are appreciated. Please note: I am a systems support guy who has to maintain pages.
function ValidateCheckedValues( ctrl , isChecked )
{
// Purpose : This function is called when the user clicks on any checkbox in the equipment requirements table on the page
// If the user clicks on the "ABC" checkbox it clears all the check boxes for that meeting,
// but if the user checked any other checkbox, it removes the check from the "ABC" checkbox
try
{
if( ctrl.parentElement.attributes("SubCode").value == "NONE" )
{
if( isChecked )
{
for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ )
{
ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false;
}
ctrl.checked = true;
}
}
else
{
if( isChecked )
{
for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ )
{
if( ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).attributes("SubCode").value == "NONE" )
{
ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false;
}
}
}
}
}
catch( ex )
{
alert( ex.message );
}
}
|
|
|
|
|
Let me guess... You are calling the function with the name of the element as first parameter instead of an actual reference to the element?
Internet Explorer adds references to the elements in the page as members of the document object. This makes it easy to access the elements, but it's non-standard so it won't work in any other browser.
Use the document.getElementById method to get a reference to the element.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi
I have written the following asp.net page and creating the xml file through a method everything is fine it is creating the file but i have a problem. May be you can help for that. it is about the xml file output when it created it showing TABLE and TABLE1 as node in xml how i can change it to meaningful name. My Code is as follows. XML file is at the bottom of the code
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Xml;
using System.IO;
public partial class _Default : System.Web.UI.Page
{protected void Page_Load(object sender, EventArgs e){
GetEmployees("London");
}
public static void GetEmployees(string City){
//String sConnection = "server=HTCWEBDEMO;database=hometrust;user id=ht_admin;password=htc_tr!st";
String sConnection = "server=ZAFAR-PC\\SQLEXPRESS;Integrated Security=SSPI;database=northwind";
SqlConnection mySqlConnection = new SqlConnection(sConnection);
mySqlConnection.Open();
// Get the same data through the provider.
//string mySQLStatement = "SELECT Title,FirstName,LastName,PhoneNumber,Faxnumber, email from contactlist where TeamName='" + TeamName +"'; select FirstName, LastName from contactlist where TeamMorty ='True' and teamname='" + TeamName + "';";
string mySQLStatement = "SELECT FirstName,LastName,Title,City from employees where city= '" + City + "';select FirstName, LastName from employees where city='" + City + "';";
//SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySQLStatement, sConnection);
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySQLStatement, sConnection);
DataSet myDataSet2 = new DataSet();
myDataSet2.DataSetName = "Contacts";
mySqlDataAdapter.Fill(myDataSet2);
// Write data to files: data1.xml and data2.xml for comparison.
myDataSet2.WriteXml("c:/temp/ContactList.xml");
mySqlConnection.Close();
}
}
XML FILE OUTPUT
<?xml version="1.0" standalone="yes" ?>
- <Contacts>
- <Table>
<FirstName>Steven</FirstName>
<LastName>Buchanan</LastName>
<Title>Sales Manager</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Michael</FirstName>
<LastName>Suyama</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Robert</FirstName>
<LastName>King</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Anne</FirstName>
<LastName>Dodsworth</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table1>
<FirstName>Steven</FirstName>
<LastName>Buchanan</LastName>
</Table1>
- <Table1>
<FirstName>Michael</FirstName>
<LastName>Suyama</LastName>
</Table1>
- <Table1>
<FirstName>Robert</FirstName>
<LastName>King</LastName>
</Table1>
- <Table1>
<FirstName>Anne</FirstName>
<LastName>Dodsworth</LastName>
</Table1>
</Contacts>
|
|
|
|
|
Stop posting and reposting your problem and do the work yourself, or get a different job because you are not qualified for the one you have. Either way, I don't care, but stop littering the CP forums with your garbage.
original[^]
led mike
|
|
|
|
|
Hi,
I have a GridView that fits my page perfectly. It's set to 800px and I have each column's width set to 10% - there are ten columns. Unfortunately, when I click on the Edit button (a command field), the width of the GridView is screwed up - it extends beyond the width of the browser window. I've tried setting the ItemStyle-Width and ControlStyle-Width on each column with no effect and I've also tried setting the EditRowStyle Width to 800px again with no effect.
Can someone tell me what I'm doing wrong and how to control what width the edit row should be?
Thanks
|
|
|
|
|
Provide the width measurement only in percent like 50% or 100%. Pixel measurements will always have display issues.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi
I've got this message and I don't know how to solve the problem.
Error message first, Source code and then the example of SQL connection.
Error message:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.]
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +1184409
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +196
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, String spName, Object[] parameterValues) +222
FG2007.objUser.LoginUser(String UserName, String Password) +108
FG2007.Login.Btn_Login_Click(Object sender, ImageClickEventArgs e) +510
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Source code:
public partial class Login : System.Web.UI.Page
{
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.btn_Login.Click += new System.Web.UI.ImageClickEventHandler(this.Btn_Login_Click);
this.btn_PukReg.Click += new System.Web.UI.ImageClickEventHandler(this.Btn_PukReg_Click);
}
#endregion
protected void Page_Load(object sender, System.EventArgs e)
{
UserName.Attributes.Add("onkeypress", "return handleEnter('" + btn_Login.ClientID + "', event)");
txtPuk.Attributes.Add("onkeypress", "return handleEnter('" + btn_PukReg.ClientID + "', event)");
if (!IsPostBack)
{
if (Request.Cookies["USERNAME"] != null)
UserName.Text = Request.Cookies["USERNAME"].Value;
if (Request.Cookies["PASSWORD"] != null)
Password.Attributes.Add("value", Request.Cookies["PASSWORD"].Value);
if (Request.Cookies["USERNAME"] != null && Request.Cookies["PASSWORD"] != null)
RememberMe.Checked = true;
}
emailp = Request.QueryString["emailp"];
if (emailp != null)
{
txtPuk.Text = emailp;
}
if (!IsPostBack)
{
string mode = Request.QueryString["mode"];
switch (mode)
{
case "pukbad":
lblPukMsg.Text = BADPUK;
lblPukMsg.ForeColor = Color.Red;
Helpers.SetFocus(this, txtPuk);
break;
case "pukformsaved":
lblPukMsg.Text = PUKFORMSAVED;
lblPukMsg.ForeColor = Color.Green;
Helpers.SetFocus(this, txtPuk);
break;
default:
lblPukMsg.Text = string.Empty;
Helpers.SetFocus(this, txtPuk);
break;
}
}
else
if (UserName.Text.Length > 0)
{
Helpers.SetFocus(this, UserName);
}
else
Helpers.SetFocus(this, txtPuk);
if (emailp != null)
{
lblPukMsg.Text = string.Empty;
lblPukMsg.ForeColor = Color.Red;
txtPuk.Text = txtPuk.Text.Trim().ToUpper();
switch (txtPuk.Text.Length)
{
case 10:
switch (objContract.CheckPuk(txtPuk.Text))
{
case 0:
case 1:
break;
case -1:
lblPukMsg.Text = BADPUK;
break;
case 2:
lblPukMsg.Text = PUKUSED;
break;
}
break;
case 12:
Guid ContractID = Guid.Empty;
Guid GroupID = Guid.Empty;
Guid FormID = Guid.Empty;
if (objGroup.CheckPuk(txtPuk.Text, out ContractID, out GroupID, out FormID) >= 0)
{
Helpers.SetCurrentContract(ContractID);
Helpers.SetCurrentGroup(GroupID);
Helpers.CheckCurrentGroup();
if (FormID != Guid.Empty)
{
lblPukMsg.Text = PUKUSED;
}
else
{
if (objContract.Current.AspektMode <= 0 && objContract.Current.ShowReports)
{
lblPukMsg.Text = CONTRACT_FINALIZED;
}
else
{
}
}
}
else
lblPukMsg.Text = BADPUK;
break;
default:
lblPukMsg.Text = BADPUK;
break;
}
}
}
private void Btn_Login_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
if (RememberMe.Checked == true)
{
Response.Cookies["USERNAME"].Value = UserName.Text;
Response.Cookies["USERNAME"].Expires = DateTime.Now.AddYears(30);
Response.Cookies["PASSWORD"].Value = Password.Text;
Response.Cookies["PASSWORD"].Expires = DateTime.Now.AddYears(30);
}
else
{
Response.Cookies["USERNAME"].Expires = DateTime.Now.AddYears(-30);
Response.Cookies["PASSWORD"].Expires = DateTime.Now.AddYears(-30);
}
objUser user = objUser.LoginUser(this.UserName.Text, this.Password.Text);
if (user != null)
{
Session["CurrentUser"] = user;
if (user.uType != objUser.UserType.Free)
{
Helpers.CheckCurrentContract();
Helpers.CheckCurrentGroup();
}
switch (user.uType)
{
case objUser.UserType.Super:
case objUser.UserType.Admin:
case objUser.UserType.Ledare:
Response.Redirect("Contracts.aspx", true);
break;
case objUser.UserType.Medlem:
Response.Redirect("Puks.aspx", true);
break;
case objUser.UserType.Free:
Response.Redirect("Support.aspx", true);
break;
case objUser.UserType.Viewer:
Response.Redirect("Reports.aspx", true);
break;
}
}
else
{
this.Lbl_Msg.ForeColor = Color.Red;
this.Lbl_Msg.Text = "<br>Fel användarnamn <br>eller lösenord.<br><br>";
}
}
Using these kind of SQL-connections:
public static DataSet ListUsers()
{
return SqlHelper.ExecuteDataset(ObjDBAbstract.GetConnectionString(), "users_list", Guid.Empty);
}
|
|
|
|
|
First of all use the CODE tag whenever you are posting code. your current code is unreadable.
ok so You are not closing the existing connection. close the connection as soon as you finished communicating.
i.e. after using the reader/datatable/dataset, insert/delete/update query.
if you are closing the connection and then also you are getting the error, due to very busy website. change the MAX POOL SIZE in the connection string.
connectionString="Server=XXX;Database=XXX;User Id=XXX;password=XXX;connection timeout=0;Max Pool Size = 100;Pooling = True"
|
|
|
|
|
Thanks for your reply
I have corrected CODE tag
I know that I am not closing the existing connection, but I do not know which, that's the problem
Thanks Anders
|
|
|
|
|
In your code
return SqlHelper.ExecuteDataset(ObjDBAbstract.GetConnectionString(), "users_list", Guid.Empty);
in the ExecuteDataset try makng use of the USING statement, this will automaically close and dispose of your connection
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I have a GridView which is teamed up with a DetailsView and they work fine. I've added New , Delete and Edit buttons to the DetailsView and that all works fine too.
The problem I have is what to do if there are no rows in the GridView . The DetailsView shows nothing, not even the buttons so I can't simply add a new item from there.
I can create a new button which will open a new page to create a new item but this seems very clumsy and inelegant.
Can someone suggest a better way of doing this? Is it possible to force the display of the DetailsView rows including the buttons, even if the GridView is empty?
Thanks
|
|
|
|
|
can update panels triger an event in paralle if yes how? please help
|
|
|
|
|
Hi - I'm new to vb.net and stuck with a little problem....I can write the string out as raw data but want to write it out so that it makes sense as "english" (formatted list I suppose). Can anybody help please? Here is my working code:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strDataToPost As String
Dim myWebRequest As WebRequest
Dim myRequestStream As Stream
Dim myStreamWriter As StreamWriter
Dim myWebResponse As WebResponse
Dim myResponseStream As Stream
Dim myStreamReader As StreamReader
' Create a new WebRequest which targets that page with
' which we want to interact.
myWebRequest = WebRequest.Create( _
"http://test..co.uk/XmlService.asmx")
' Set the method to "POST" and the content type so the
' server knows to expect form data in the body of the
' request.
With myWebRequest
.Method = "POST"
.ContentType = "text/xml"
End With
' Here's the data I'll be sending. It's the same format
' you'd use in a querysting and you should URLEncode any
' data that may need it.
strDataToPost = "<RegionSearch>blah</RegionSearch>"
' Get a handle on the Stream of data we're sending to
' the remote server, connect a StreamWriter to it, and
' write our data to the Stream using the StreamWriter.
myRequestStream = myWebRequest.GetRequestStream()
myStreamWriter = New StreamWriter(myRequestStream)
myStreamWriter.Write(strDataToPost)
myStreamWriter.Flush()
myStreamWriter.Close()
myRequestStream.Close()
' Get the response from the remote server.
myWebResponse = myWebRequest.GetResponse()
' Get the server's response status?
' Just like when we sent the data, we'll get a reference
' to the response Stream, connect a StreamReader to the
' Stream and use the reader to actually read the reply.
myResponseStream = myWebResponse.GetResponseStream()
myStreamReader = New StreamReader(myResponseStream)
litResponseText.Text = myStreamReader.ReadToEnd()
myStreamReader.Close()
myResponseStream.Close()
' Close the WebResponse
myWebResponse.Close()
End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ASP.NET HTTP Post Request Sample</title>
</head>
<body>
<form id="myForm" runat="server">
<p>
<strong>This page made an HTTP post request to:</strong><br />
<code> http://test..co.uk/XmlService.asmx
</code>
</p>
<p>
<strong>It sent regions request data:</strong><br />
</code>
</p>
<p>
<strong>The Response:</strong>
</p>
<table border="1">
<tr><td>
<asp:Literal ID="litResponseText" runat="server" />
</td></tr>
</table>
<hr />
</form>
</body>
</html>
Kind regards
Andy
|
|
|
|
|
I'm using this code to run process:
"...
_apppath = String.Concat(_apppath, "zvprtcfg_win32");
string _command = " Zan Image Printer(fax) print.html = ";
_command += strHtmlFileName;
try
{
Process _proc = new Process();
_proc.StartInfo.Arguments = _command;
_proc.StartInfo.FileName = _apppath;
if (_proc.Start())
{
int _i = 0;
do
{
_proc.WaitForExit(1000);
if (_proc.HasExited)
{
_bOk = true;
break;
}
} while (_proc.Responding && _i++ < 30);
if (!_bOk)
{
_proc.Kill();
}
}
}
catch (Exception eproc){}
..."
This works fine with my XP machine with IIS V5.1, but I can't make this work with Server 2003 and IIS V6.0.
In Server 2003, the process shows in the task manager, but it doesn't execute as I'm expecting.
ASPNET user run "zvprtcfg_win32" process on my machine and NETWORK SERVICE user run it on Server 2003.
Please give me some advice, solution...
Thanks in advance.
"...And then she'd say, it's Ok, I got lost on the way
but I'm a supergirl, and supergirls don't cry. ..." Reamonn
|
|
|
|
|
Hi,
I think the problem is the account "Network Service". This one will not have the rights to run your process as you expecting it. Try to figure out what rights for this user are missing (file, printer access etc.).
The network service is the default user for ASP.NET under Win2003 and IIS 6.0. Maybe you can figure out how to change the default use, so that ASP.NET is executed with other permissions.
Hope this helps you a bit.
Regards
Sebastian
P.S. Have a look at the event log of Windows, there you will find some information about critical operations etc, which where denied.
|
|
|
|
|
Thank you very much.
Everything you wrote I already know, but I totally forgot "P.S." part . And there (at the Event log) was solution to my problem.
Thanks once more.
Regards,
Nina
My problem was:
The machine-default permission settings do not grant Local Activation permission for Internet Explorer to the user NT AUTHORITY\NETWORK SERVICE.
"...And then she'd say, it's Ok, I got lost on the way
but I'm a supergirl, and supergirls don't cry. ..." Reamonn
|
|
|
|
|