|
OK. I would recommend buying a book on databases and reading it, and also becoming familiar with the help files that come with SQL Server ( typing 'backup database' into those is the best way to answer this question ).
Right click on the DB and choose backup. Then give the backup to your friend, and he will restore it into his instance of SQL Server.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello All,
I want to implement following functionality in my project. Could you please tell me which sms gateway are available which provide following service.
- Suppose a user of my website currently in Chicago then at that time i a displaying his status on my webiste
i.e xyz checked in Chicago 10 min ago.
- A another user which is friend of user xyz is checked in other part of chicago
or any where then at that time xyz user should get a message
pqr checked in "His location".
Which sms gateway will send automated message like this by checking location of user and i want to integrate them with my website.
EX- brightkite.com
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
The site you refer to has a developer API. I assume that they are requiring the people you're tracking to run their app on the phone, and the phone would need to have GPS. How on earth would an SMS gateway keep track of where people are ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Yes the phone need to have a GPS.
Every phone has an option "Cell Info Display" which tell us the location where we are.
By using this we know the current status of user.
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hello frnds,
I havestucked into a problem. I am unable to delete multiple rows directly from the gridview ie without any interaction with the database. Please help me out. What I have done is like this.
1 protected void BtnDelete_Click(object sender, EventArgs e)
2 {
3 try
4 {
5 dt = (DataTable)Session["Cart"];
6 CheckBox chkSelected = new CheckBox();
7 foreach (GridViewRow rowItem in GridView1.Rows)
8 {
9 chkSelected = (CheckBox)rowItem.FindControl("chkSelection");
10 index = rowItem.RowIndex;
11
12 if (chkSelected.Checked == true)
13 {
14 dt.Rows.RemoveAt(index);
15 dt.AcceptChanges();
16 }
17 }
18 GridView1.DataSource = dt;
19 GridView1.DataBind();
20 Session["Cart"] = dt;
21 }
22 catch(Exception ee)
23 {
24 Lblmsg.Text = ee.Message;
25 }
26
27
28 }
This code is working fine If I delete only one row. But suppose I have 3 rows in the gridview and I checked all the three, then it will give an error that "there is no item at position 2". That means after deleting ,the datatable is not refresing its index.
please help me.
cheers
sneha
cheers,
sneha
|
|
|
|
|
You are getting the row index from the gridview, but you're manipulating the rows in the session data table. As a result, as soon as you remove one item, the number of rows is no longer the same, nor will the indexes be the same.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks Sir. I was making that silly mistake.
Thank you very much.
cheers,
sneha
|
|
|
|
|
Hi Sneha,
You can delete by getting the rowID. After gettin the rowID, you can run code which you have written.
hope this will help
Regards
Ravi
|
|
|
|
|
Hi ,
i want to insert null for date,when i do this database is taking date as 1900-01-01 , i want it to be blank , i am doing, add and edit pages,when i retrive data while editing date is coming as 1900-01-01 , help me resolving this.
cancellation_date date,
i am using syabase as database,
|
|
|
|
|
Well, does your column accept nulls ? It doesn't sound like it, it sounds like somewhere, the code or the database is inserting a default value.
This has nothing to do with ASP.NET.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks for the reply,
the column accept nulls , through code i am not inserting any default values , how to stop databse inserting default values.
|
|
|
|
|
Impossible for me to say, because, again, you're not showing me any code. You either have a default value for the column which is being inserted for some reason, or there's something wrong with the code that is doing the inserting. I'd start in the database manager for your DB, and do some inserts into that table from there, and see what happens, to see if the problem is your DB code or your .NET code.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi my code
OdbcCommand cmd = new OdbcCommand("{call InsertRetailer(" + Convert.ToInt32(txtRetailerId.Text) + ",'" + txtRetailerName.Text + "','" + txtAppointedDate.Text + "'," + ddlStatus.SelectedValue + ",'" + txtCancellationDate.Text + "'," + ddlRegion.SelectedValue + "," + txtCreditLimit.Text + ",'" + txtContactPerson.Text + "','" + txtAddress1.Text + "','" + txtAddress2.Text + "'," + ddlState.SelectedValue + ",'" + txtPostcode.Text + "','" + txtTelephone.Text + "','" + txtMobile.Text + "','" + txtFax.Text + "','" + txtEmail.Text + "'," + ddlDistributor.SelectedValue + ",'" + txtTaxId.Text + "'," + sell + "," + cancel + "," + pay + "," + ddlSchemeId.SelectedValue + ",'" + txtBankNumber.Text + "','" + txtBranchNumber.Text + "','" + txtBankAccountNo.Text + "')}", Conn);
create procedure InsertRetailer
@retailer_id numeric=null,
@name varchar(1000)=null,
@appoint_date NVARCHAR(20),
@status_id numeric=null,
@cancellation_date NVARCHAR(20),
@region_id numeric=null,
@credit_limit numeric(22,2)=null,
@contact_name varchar(1000)=null,
@addr1 varchar(1000)=null,
@addr2 varchar(1000)=null,
@state_id numeric=null,
@pincode varchar(1000)=null,
@telephone varchar(1000)=null,
@mobile varchar(1000)=null,
@fax varchar(1000)=null,
@email varchar(1000)=null,
@distributor_id numeric=null,
@tax_id varchar(1000)=null,
@sell_enable numeric=null,
@cancel_enable numeric=null,
@pay_enable numeric=null,
@scheme_id numeric=null,
@bank_number varchar(1000)=null,
@branch_number varchar(1000)=null,
@bank_acct_number varchar(1000)=null
as
begin
insert into retailer(retailer_id,name,appoint_date,status_id,cancellation_date,region_id,credit_limit,contact_name,addr1,addr2,state_id,pincode,telephone,mobile,fax,email,distributor_id,tax_id,sell_enable,cancel_enable,pay_enable,scheme_id,bank_number,branch_number,bank_acct_number)
values(@retailer_id,@name,@appoint_date,@status_id,@cancellation_date,@region_id,isnull(@credit_limit,0),@contact_name,@addr1,@addr2,@state_id,@pincode,@telephone,@mobile,@fax,@email,@distributor_id,@tax_id,@sell_enable,@cancel_enable,@pay_enable,@scheme_id,@bank_number,@branch_number,@bank_acct_number)
end
|
|
|
|
|
OK, this is for school work ? No-one is paying for this code, right ?
A malicious user can trivially erase your entire database.
As to the code, You're storing dates as strings instead of a date type. Doesn't your db have a date type ? This means that something in your code has to be doing the conversion. Which variable in this mess is the one that's being changed ? you've stepped through the debugger and you're sure a null is being passed ? I don't see how that is possible, a string from a textbox is never null.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi All,
I have one problem.I have done chat application.but my problem is:
suppose one customer and four employees are online.customer wants to chat perticular employee.First i want to send message to that perticular employee:"pls be online,customer wants to chat".
but my problem is how can i send this alert message to perticular employee who selected by customer?
This is the web appication.
pls help as early as possible.
Thanx
|
|
|
|
|
You obviously cannot, unless it's via email. This is an obvious limitation of a web app, if they are not on your page, you can't send them anyting.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Assuming the employee with whom the customer wants to chat is online, then doesn't your apppllication allow them to chat to them already - isn't that what a chat application is for?
If the employee is not online then, obviously, you can't send a message to them (well, you could phone them up, or email them, or send them a telegram, but if they're not using the chat application you're stuffed)
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hi There,
I am working with Asp.Net 2.0 with C#.net. In my project I had created a error message box using Div tag.If I run the project in Mozila 2.0 then it runs properly but when I run the project in enternet explorer 6.0 then it didnt show the message box.
What is the problem.Can anybody help me.
Thanks
|
|
|
|
|
enternet explorer ? I'm sorry, that's hilarious.
The problem is that your code is broken. Duh. Perhaps if you gave us code, we could try to help you, but, broadly, it's always the case that you should test across all browsers you're targetting, and be ready to rewrite something if it doesn't display properly in some browsers.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks For Reply,
This Code I had written in Master Page it is working properly in Mozila 2.0.
function showBox(str)
{
var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
var layer = document.createElement('div');
layer.style.zIndex = 2;
layer.id = 'layer';
layer.style.position = 'absolute';
layer.style.top = '0px';
layer.style.left = '0px';
layer.style.height = document.documentElement.scrollHeight + 'px';
layer.style.width = width + 'px';
layer.style.backgroundColor = 'LightGray';
layer.style.opacity = '.7';
layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=80)");
document.body.appendChild(layer);
var div = document.createElement('div');
div.style.zIndex = 3;
div.id = 'box';
div.style.position = (navigator.userAgent.indexOf('MSIE 6') > -1) ? 'absolute' : 'fixed';
div.style.top = '200px';
div.style.left = (width / 2) - (400 / 2) + 'px';
div.style.height = '100px';
div.style.width = '400px';
div.style.backgroundColor = 'White';
div.style.border = '4px solid silver';
div.style.padding = '20px';
document.body.appendChild(div);
var myimg = document.createElement('IMG');
myimg.src= "../images3.jpg";
myimg.width= '50';
myimg.height = '50';
myimg.visible="true";
div.appendChild(myimg);
var p = document.createElement('p');
p.innerHTML = str;
p.style.position = "absolute";
p.style.top = '20px';
p.style.fontSize=14+'px';
p.style.fontWeight = "bold";
p.style.left = (width / 2) - (800 / 2) + 'px';
div.appendChild(p);
var btn=document.createElement('Button');
btn.innerHTML='Ok';
btn.style.border='2px solid silver';
btn.style.opacity = '.6';
btn.style.fontSize=16+'px';
btn.style.fontWeight = "bold";
btn.style.border='solid';
btn.style.position = "absolute";
btn.style.top = '100px';
btn.style.left = (width / 2) - (620 / 2) + 'px';
btn.onclick = function()
{
document.body.removeChild(document.getElementById('layer'));
document.body.removeChild(document.getElementById('box'));
};
div.appendChild(btn);
}
|
|
|
|
|
OK, well, that's probably because IE ignores standards, but you have no choice but to work out which bit IE is ignoring, and to do something about it. I'd just google for code to do this, and expect that someone else has solved this already.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks for reply,
If you find any solution please reply as soon as possible.
Thanks.
|
|
|
|
|
I promise you, I am doing my own work, not yours. Browser compatibility is a nightmare, your bet bet is to google for a script that handles this.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Dear fellows
I've been fiddling about with some code I inherited that I hoped would allow me to delete users from my database.
The users are actually part of the asnet users scheme not just a simple record table.
I'm getting the error message stated in the title of my query.
The funny thing is, is that it seems to be deleting the user but also returning me the error essage.
can anyone tell me what is going wrong?
I've been googling but not had much luck.
Thanks in advance.
Here's what I'm doing..............
The markup:
<asp:gridview id="gvUsers" allowpaging="true" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
DataSourceID="allUsersDataSource" EmptyDataText="There are no matching users in the system."
PageSize="5" BorderStyle="Solid" BorderColor="#6AA6CC">
<footerstyle cssclass="GridFooter"></footerstyle>
<rowstyle cssclass="GridItem"></rowstyle>
<alternatingrowstyle cssclass="GridAltItem"></alternatingrowstyle>
<pagerstyle cssclass="GridFooter" /><headerstyle cssclass="GridHeader"></headerstyle>
<columns>
<asp:templatefield headertext="Active" itemstyle-width="40" itemstyle-horizontalalign="Center">
<itemtemplate>
<asp:checkbox runat="server" id="chkActive" oncheckedchanged="EnabledChanged" autopostback="true">
Checked='<%#DataBinder.Eval(Container.DataItem, "IsApproved")%>' Value='<%#DataBinder.Eval(Container.DataItem, "UserName")%>' />
</asp:checkbox></itemtemplate>
</asp:templatefield>
<asp:templatefield runat="server" headertext="User Name" itemstyle-width="160">
<itemtemplate>
<a href="Admin_UsersEdit.aspx?username=<%#Eval("UserName")%>">
<%#DataBinder.Eval(Container.DataItem, "UserName")%></a>
</itemtemplate>
<itemstyle width="160px"></itemstyle>
</asp:templatefield>
<asp:templatefield headertext="Email" itemstyle-width="180" itemstyle-horizontalalign="Left">
<itemtemplate>
<asp:hyperlink id="EmailLink" runat="server" navigateurl="<%# Eval("Email", "mailto:{0}") %>">
Text='<%# Eval("Email") %>'></asp:hyperlink>
</itemtemplate>
<itemstyle horizontalalign="Left" width="180px"></itemstyle>
</asp:templatefield>
<asp:boundfield datafield="CreationDate" headertext="Created On" readonly="True">
SortExpression="CreationDate" ItemStyle-HorizontalAlign="Center">
<itemstyle horizontalalign="Center"></itemstyle>
</asp:boundfield>
<asp:boundfield datafield="LastLoginDate" headertext="Last Login" sortexpression="LastLoginDate">
ItemStyle-HorizontalAlign="Center">
<itemstyle horizontalalign="Center"></itemstyle>
</asp:boundfield>
<asp:templatefield runat="server" itemstyle-horizontalalign="Center">
<itemtemplate>
<asp:linkbutton runat="server" id="linkButton2" text="Delete" commandname="delete">
CommandArgument='<%#DataBinder.Eval(Container.DataItem, "UserName")%>' ForeColor="black"
OnCommand="LinkButtonClick" />
</asp:linkbutton></itemtemplate>
<itemstyle horizontalalign="Center"></itemstyle>
</asp:templatefield>
</columns>
<emptydatarowstyle font-italic="True" />
</asp:gridview>
my code behind:
Public Sub LinkButtonClick(ByVal sender As Object, ByVal e As CommandEventArgs)
If e.CommandName.Equals("delete") Then
Dim userName As String = DirectCast(e.CommandArgument, String)
Membership.DeleteUser(userName)
Response.Redirect("admin_users.aspx", False)
End If
End Sub
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
I'm trying out that FreeTextBox control but wondering how you can pass it an HTML file to display at runtime?
|
|
|
|
|