|
ya, i saw it by removing double quotes also. But still its not working.
|
|
|
|
|
Hi
I am having problems with my asp page on my remote webserver
Every time i try to use a stored procedure it returns saying a table doesn't exist
If i put in a select query into the command the line the table is there
has anyone got any ideas?
cheers
boyindie
|
|
|
|
|
Two things come to mind:
1: Do you have the requisite permissions on the database objects?
2: Is the page using the correct connection string?
|
|
|
|
|
I have sorted the problem
I was tryin to add to a users table
I am guessin that is a keyword or somthing in mySQL
as i changed the table name to system_users and it works fine now
cheers
boyindie
|
|
|
|
|
|
i have string which has xml data like
<addressrow> <addressid>0 <foreigntablename>tblPerson <foreignkeyid>0 <address1>idb1 idb2 <address2>idb3 <address3>idb4 <state>NY <zip>12436 <addressisvalid>True <datecreated>8/10/2007 1:30:20 PM <countryidf>US
now i have to parse this string and store each attribute values in string array
which method i have to use. please provide some help or code
|
|
|
|
|
Hi i am trying to insert data into a database using store procedure but it gives me this error "An SqlParameter with ParameterName '@Name' is not contained by this SqlParameterCollection" and here is my code
string conString = @"Data Source=DAKESERVER;Initial Catalog=Customer;User ID=sa";
SqlConnection conCustomer = new SqlConnection(conString);
conCustomer.Open();
try
{
SqlCommand cmdCustomer = new SqlCommand("AddCustomer");
cmdCustomer.Connection = conCustomer;
cmdCustomer.CommandType = CommandType.StoredProcedure;
cmdCustomer.Parameters["@Name"].Value = txtName.Text.ToString();
cmdCustomer.Parameters["@Surname"].Value = txtSurname.Text.ToString();
cmdCustomer.Parameters["@Address"].Value = txtAddress.Text.ToString();
cmdCustomer.Parameters["@Telephone"].Value = txtTelephone.Text.ToString();
if (cmdCustomer.ExecuteNonQuery() == 1)
{
lblMessage.Text = "Record inserted";
}
else
{
lblMessage.Text = "record not inserted";
}
}
catch (Exception ex)
{
lblMessage.Text = ex.Message;
}
finally
{
conCustomer.Close();
}
Mamphekgo
|
|
|
|
|
Have u declare parameter @Name is StoredProcedure?
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
yes i did declared it
Mamphekgo
|
|
|
|
|
I am getting following error in production environment
i.e The state information is invalid for this page and might be corrupted error while executnin aspx page.It is working fine in Development environment.
Please any one can give clue about this
|
|
|
|
|
Hi
In my application, I have a ListBox which is to be filled with the values in XML file.
My application goes like this.....
I am getting a State name of USA from the QueryString, with the help of a that QueryString I have to get the Names of Counties of that State, which r in a XML file on to a ListBox.
My XML File looks like this
<USA>
<CountyUSA>
<StateCode>AK</StateCode>
<StateName>Alaska </StateName>
<CountyName>Aleutians East</CountyName>
</CountyUSA>
<CountyUSA>
<StateCode>AK</StateCode>
<StateName>Alaska </StateName>
<CountyName>Aleutians West</CountyName>
</CountyUSA>
.....
.....
<CountyUSA>
<StateCode>AL</StateCode>
<StateName>Alabama </StateName>
<CountyName>Autauga</CountyName>
</CountyUSA>
<CountyUSA>
<StateCode>AL</StateCode>
<StateName>Alabama </StateName>
<CountyName>Baldwin</CountyName>
</CountyUSA>
.....
.....
<CountyUSA>
<StateCode>GA</StateCode>
<StateName>Georgia </StateName>
<CountyName>Campbell</CountyName>
</CountyUSA>
<CountyUSA>
<StateCode>GA</StateCode>
<StateName>Georgia </StateName>
<CountyName>Milton</CountyName>
</CountyUSA>
</USA>
How can I get only County Names of a particular State for this XML file.
Suggest me an Example.
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
XmlDataDocument xdoc = new XmlDataDocument();<br />
XmlTextReader Reader = new XmlTextReader(server.MapPath("XML.xml"));<br />
xdoc.DataSet.ReadXml(Reader, XmlReadMode.InferSchema);<br />
ddl.datasource=xdoc.dataset;<br />
ddl.DataTextField="CountryName";<br />
ddl.databind();
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Thank u Imran Khan Pathan for u reply.
It is giving only the Counties of only one State i.e first in the list.
I want to get Counties of different States with the help of a QueryString.
Where I have to give this QueryString to get the Data for Different State's Counties
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
U can select using DataTabale.Select Method
DataTable dt=ds.table[0];
datarow[] dr=dt.select("State='"+var+"'");
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Ok
How can I use this in your given code.
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
DataSet ds=xdoc.dataset;<br />
DataTable dt=ds.table[0];<br />
DataRow[] dr=dt.select("State='"+statename+"'");<br />
DataTable dt1=new DataTable();<br />
foreach(DataRow dr1 in dr)<br />
{<br />
dt1.Rows.Add(dr1)<br />
}<br />
ddl.DataSource=dt1;<br />
ddl.DataTextField="CountryName";<br />
ddl.databind();
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
use this code to bound ur dropdownlist anjoy the coding
Dim _Doc As New System.Xml.XmlDocument
_Doc.Load("file:///C:/testxml.xml")
Dim NodeList As System.Xml.XmlNodeList = _Doc.SelectNodes("/USA/CountyUSA/CountyName")
For Each node As System.Xml.XmlNode In NodeList
Dim ss As String = node.InnerText
DropDownList1.DataSource = ss
DropDownList1.DataBind()
Next
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
where i stored CountyName in ss string. u store all CountyName in hash table or collection then bind drop down list(out side the for each)
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
Thank u for u r reply Piyush Vardhan Singh
But I am having all the County Names of different States in a single XML file.
How can I get County Names of each State in order to bind that Data to ListBox.
As I said earlier I getting that State Name in a QueryString, with that Name in the QueryString I have to get the Couty Names of that State.
How can I make this kind of selection.
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
Hello,
VS 2005
I tried to follow this article about how to specify a virtual directory to install a web service project.
http://www.codeproject.com/useritems/ChangeVDirWebSetupProject.asp
In my project i am using a installer class and 1 custom action. But I don't think this would cause any problem, as it worked everytime before I added the virtual directory.
However, i get this error message during the installation.
Exception occurred while initializing the installation.
System.IO.FileNotFoundException: Could not load file or assembly.
'File:///C:\windows\System32\Software\myWebService\Website\PDA\' or one of its dependencies. The system cannot find the file specified.
If anyone has had this kind of error before, or know of a better method to specify a virtual directory to install to. Please let me know.
Many thanks,
Steve
|
|
|
|
|
Hi to all,
When i change the state of asp.net checkboxlist using javascript, code behind is not getting the currently change state of control,
actually i have checkboxlist control of asp.net with 3 members, agaisnt them i have 3 dropdownlist controls of asp.net, when i check first check box dropdownlist no.1 enable and vice versa, but when i enable the dropdownlist using javascript, code behind dont consider it as enable, in code behind i do disable dropdownlist and using javascript i want to enable or disable them.
Java script function which i am using,
------
function Toggle()
{
var TB = document.getElementById('chk_list').childNodes[0];
var d1 = document.getElementById("ddl_mbbs");
var d2 = document.getElementById("ddl_fcps");
var d3 = document.getElementById("ddl_dlo");
var d4 = document.getElementById("ddl_other");
var t = document.getElementById("txtOthers");
for (var i=0;i<tb.childnodes.length; i++)
="" {
="" var="" currenttd="TB.childNodes[i].childNodes[0];
" listcontrol="currentTd.childNodes[0];
"
="" if="" (="" i="=" 0="" )
="" listcontrol.checked="=" true="" d1.disabled="false;
" else
="" }
="" 1="" d2.disabled="false;
" }="" 2="" d3.disabled="false;
" 3="" d4.disabled="false;
" t.disabled="false;
" }
<="" script="">
----------
And code behind is
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
chk_list.Items(0).Attributes.Add("onclick", "ToggleTextbox();")
chk_list.Items(1).Attributes.Add("onclick", "ToggleTextbox();")
chk_list.Items(2).Attributes.Add("onclick", "ToggleTextbox();")
chk_list.Items(3).Attributes.Add("onclick", "ToggleTextbox();")
If Not IsPostBack Then
add_years()
chk_box()
End If
End Sub
Sub add_years()
Dim i As Integer = 1930
For i = 1930 To Now.Year
ddl_mbbs.Items.Add(i)
ddl_fcps.Items.Add(i)
ddl_dlo.Items.Add(i)
ddl_other.Items.Add(i)
Next
End Sub
Sub chk_box()
ddl_mbbs.Enabled = False
txtOthers.Enabled = False
ddl_fcps.Enabled = False
ddl_dlo.Enabled = False
ddl_other.Enabled = False
End Sub
Protected Sub btn_submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_submit.Click
If ddl_mbbs.SelectedValue = "None" Then
lblerr.Text = "Enter Qualification."
Else
Session.Add("fname", Txt_fname.Text)
If ddl_mbbs.Enabled = True Then
Session.Add("mbbs", ddl_mbbs.SelectedValue)
Else
Session.Add("mbbs", -1)
End If
If txtOthers.Enabled = True Then
Session.Add("mcps", ddl_other.SelectedValue)
Session.Add("str_others", txtOthers.Text)
Else
Session.Add("mcps", -1) '---------------Change mcps = -1
End If
If ddl_fcps.Enabled = True Then
Session.Add("fcps", ddl_fcps.SelectedValue)
Else
Session.Add("fcps", -1)
End If
If ddl_dlo.Enabled = True Then
Session.Add("dlo", ddl_dlo.SelectedValue)
Else
Session.Add("dlo", -1)
End If
Response.Redirect("regDoc_1.aspx")
End If
End Sub
-----------------------
If someone could help
|
|
|
|
|
Hi All,
How can i display xml node and sub node(only element)in multi level hierarchial grid. if any one have some sample code please send me.
My sample xml file is:
<ctfile>
<documentname>CES Student File
<ctfversion>1.1
<documentcreationdatetime>2006-01-17T14:29:48
<documentqualifier>full
<supplierid>SIMS
<sourceschool>
<lea>
<estab>
<schoolname>
<ctfpupildata>
<upn>
<surname>
<forename>
<dob>
<gender>
<basicdetails>
<preferredsurname>BATES
<preferredforename>RYAN
<ncyearactual>10
<ethnicity>WBRI
Thanks & Regards,
Pravat Sharma
Pravat Sharma
|
|
|
|
|
i want to calculate the address of the client which is accessing my website. fro that i am using the following code.
Request.UserHostAddress.ToString()
is this right
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
I don't think so, it will give you the address of the server. Try this instead:
Request.ServerVariables["REMOTE_ADDR"].ToString();
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Hi there,
I've got a problem about usercontrol in asp.net 2.0.
In my usercontrol, I've got a button and a public property. When the button is clicked, the property will be set to 1.
public partial class WebUserControl : System.Web.UI.UserControl<br />
{<br />
private int _number;<br />
<br />
public int Number {<br />
get {<br />
return this._number;<br />
}<br />
set {<br />
this._number = value;<br />
}<br />
}<br />
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
this._number = 10;<br />
}<br />
}
Then, I put this usercontrol into a page. Set its Number property to 1.
The problem is after I click the usercontrol's button, its Number property didn't change to 10
Any wrong here???
Pls help me. Thanks alot.
|
|
|
|