|
This can also be done with AJAX. You have the user-facing page, an AJAX script, and a dynamic page. The user's selection passes a value over an XmlHttp request to a dynamic page, the output is returned via XmlHttp, and the contents of the user-facing page are changed via Javascript. Check out this example which has samples of all three parts-
http://w3schools.com/ajax/ajax_database.asp[^]
Good luck!
Ranjit Viswakumar
Professional Services Specialist
HostMySite.com[^]
|
|
|
|
|
Sure - it's almost the canonical AJAX example. I was just trying not to confuse the guy tho.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello
SQL Server Databse keeps order information.
I want to send an automatic email to customer if order has been placed.
Any Solution
Thanks
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
Yeah, the solution would be to automatically send an email when the order is placed. Might want to do that somewhere around your insert statement in your code, since that's probably where the order is complete in your end.
|
|
|
|
|
Did you consider trying to write some code to do this ? I don't see what SQL Server has to do with it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
could you please give some instruction
Sarfarj Ahmed
|
|
|
|
|
|
Thank you very much, i will folloe your instruction.
Sarfarj Ahmed
|
|
|
|
|
is this query correct?
"INSERT INTO Create(names,city,state,email,username,pword,securityq,answer) VALUES('" + name + "','" + city + "','" + state + "','" + email + "','" + user + "','" + pswd + "','" + question + "','" + ans + "')";
error is Incorrect syntax near the keyword 'Create'
|
|
|
|
|
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...) is the synatax from w3schools.com[^]
is Create your table name?
try putting insert into `create` (...) values(...)
example
INSERT INTO `Persons` (P_Id, LastName, FirstName)
VALUES (5, 'Tjessem', 'Jakob')
|
|
|
|
|
What is name, city, etc ? Where do they come from ? It looks to me like your database security is a nightmare.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
"Create" is a reserved word in MSSQL so it cannot be used as the name of a table. Here is a full list of reserved words:
http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx[^]
You should be able to insert into the table by quoting the table name like so:
INSERT INTO "Create" ...
Joe Ceresini
Network Engineer
jceresini@hostmysite.com
Hostmysite.com
modified on Monday, February 2, 2009 7:10 PM
|
|
|
|
|
I'm trying to display content from db, but i'm getting this error on my page
ExecuteReader requires an open and available Connection. The connection's current state is closed.
My code is this:
public partial class admin_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
GetPageData();
}
private void GetPageData()
{
DBConnection obj = new DBConnection();
SqlDataReader reader;
DataTable dt = new DataTable();
string query = string.Empty;
try
{
query = "select * from menus order by name";
reader = obj.ExecuteRecordSet(query);
dt.Load(reader);
}
catch (Exception ex)
{
errlbl.Text = ex.Message.ToString();
}
finally
{
obj.CloseConnection();
}
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void lkAdd_Click(object sender, EventArgs e)
{
Response.Redirect("addmenus.aspx");
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GetPageData();
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string query = "delete from menus where id=" + GridView1.DataKeys[e.RowIndex].Value.ToString();
DBConnection obj = new DBConnection();
try
{
obj.ExecuteSql(query);
}
catch (Exception ex)
{
}
GetPageData();
}
}
|
|
|
|
|
Sure would be nice for you to just post the pertinent code, or point out what line has the issue
DBConnection obj = new DBConnection();
SqlDataReader reader;
DataTable dt = new DataTable();
string query = string.Empty;
try
{
query = "select * from menus order by name";
reader = obj.ExecuteRecordSet(query);
dt.Load(reader);
So, obj is a DBConnection. What is that ? A custom class ? Where does it say that you specified a database to connect to, and connected to it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
|
Hi,
I am working on asp.net. I want to add the drag and drop functionality on the controls. I managed to draw the controls but could any one tell how I can add drag drop functionality in it. I tried using Microsoft.Web.Preview but it creates a havoc ..is there any other way? Any kind of help or e article/example web link will be good support .
Thanks in advance!!
|
|
|
|
|
webparts section in asp.net toolbox will fullfill your requirement to achieve drag and drop functionality..
umerumerumer
|
|
|
|
|
|
Hello EveryBody....
I want help. can any one plz suggest me that what can i do becoz i want to compare the value from a database field that contains about 160 millions records. for Example
table contains a field called Email taht contains about 160 millions Adresses. Now when some one enters new email Address. Now i want to compare with existing records and remove them if a duplicate Entry Exists.
|
|
|
|
|
AhmedNisar82 wrote: what can i do becoz i want to compare the value from a database field that contains about 160 millions records
Index it first.
AhmedNisar82 wrote: Now i want to compare with existing records and remove them if a duplicate Entry Exists.
Cache this information in your application memory and od the comparision from the in memory records.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Manas Bhardwaj wrote: Cache this information in your application memory and od the comparision from the in memory records
That is a seriously screwed up idea! You are crazy if you think that's a good idea.
Let SQL Server do what SQL Server is best at and have it do the comparison rather than saturate your network with 160 million rows of data and then bring the client PC to its knees because you've just dumped a shed-load of data in it.
What do you think the memory requirements are for 160 million rows?
Assume an integer primary key: 4 bytes
Assume each address is an average of say 32 characters (using a western alphabet) 32 bytes.
36 bytes * 160 million = 5,760,000,000
In total that is just shy of 6Gb you want to dump in RAM! On top of that you have overhead for the operating system, other applications and so on.
[UPDATE] Okay, I misready what sort of address. If we assume 20 bytes for an email address, the memory requirement is less, but it is still significant. 24 * 160 million = 3.8Gb
modified on Monday, February 2, 2009 11:45 AM
|
|
|
|
|
thnx 4 ur comments....
my application runs on server not on the client side......
So.?????????
|
|
|
|
|
AhmedNisar82 wrote: my application runs on server not on the client side
Be aware that "client" in the context that I used it meant any process outside of SQL Server i.e. Any client of SQL Server.
The "client" could be on the same machine as SQL server, or another machine. Either way the effect of memory consumption is the same. If the process is on the same machine as SQL Server then you don't have the network bandwidth issues.
|
|
|
|
|
AhmedNisar82 wrote: Now i want to compare with existing records and remove them if a duplicate Entry Exists.
If you do this you won't have to remove stuff because you can prevent the duplicate being inserted in the first place.
IF EXISTS (SELECT * FROM MyTable WHERE Email = @newEmail)
BEGIN
-- Perform action based on email address already existsin
END
ELSE
BEGIN
-- Perform action based on email address not existing.
END
|
|
|
|