|
niki_nilu wrote: but how to call stored procedure in asp.net 2.0 with c#.
ASP.NET is a framework for dealing with web applications. It has nothing to do with databases. However, you can use ADO.NET for accessing databases.
This is an example of what you might use. You need to replace bits of this with your own variables and the like:
using(SqlConnection connection = new SqlConnection("Your connection string here"))
{
SqlCommand command = new SqlCommand();
command.Connection = connection;
command.CommandText = "Analyst";
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@UserId", theUserId);
command.Parameters.AddWithValue("@StockName", theStockName);
command.Parameters.AddWithValue("@NewUserId", theNewUserId);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}
Please check your stored procedure. You pass a parameter called @NewUserId which is never used.
|
|
|
|
|
Colin Angus Mackay wrote: SqlCommand command = new SqlCommand();
Will the SQLCommand instance automatically get disposed after the execution ?
|
|
|
|
|
N a v a n e e t h wrote: Will the SQLCommand instance automatically get disposed after the execution ?
You know. I never realised that SqlCommand even had a Dispose method. It is the connection that holds the external resource. I'm not entirely sure what rare or unmanaged resources the command holds on to.
|
|
|
|
|
Colin Angus Mackay wrote: I never realised that SqlCommand even had a Dispose method
I always used to wrap command object in using statement. I have seen using for SQLConnection in your example, but for SQLCommand it was not there. So just cleared. Thanks,
|
|
|
|
|
Thanku very much
its relly useful for me.
thanks again
gayatri
Gayatri
|
|
|
|
|
Hi!
My company bought a software from other company and that company provides us an Apache Java Web Service.
I have to connect to that web service using C#. I use Http Web Request to do that ?
Is it secure to use Http Web Request?
If it's not, how do i make it more secure?
how to download document from Apache Java Web Service using HttpWebRequest ?
Is there any tutorial about using C# to connect to Java Web Service
string inputXML = "";
inputXML = inputXML + " http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>";
inputXML = inputXML + "<soapenv:body>";
inputXML = inputXML + " http://url'>";
inputXML = inputXML + "<packagename>test";
inputXML = inputXML + "<servicename>TestServices ";
inputXML = inputXML + "<methodname>Download";
inputXML = inputXML + "<parameterlist>";
inputXML = inputXML + "<attribute>";
inputXML = inputXML + "<attributename>User";
inputXML = inputXML + "<attributevalues>";
inputXML = inputXML + "<strloginname>" +test+ "";
inputXML = inputXML + "<strpassword>" + test + "";
inputXML = inputXML + "";
inputXML = inputXML + "";
inputXML = inputXML + "";
inputXML = inputXML + "";
inputXML = inputXML + "";
inputXML = inputXML + "";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(inputXML);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Headers.Add("SOAPAction","");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
xmlDoc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
string sRet = r.ReadToEnd();
|
|
|
|
|
miauwmiauwmiauw wrote: My company bought a software from other company and that company provides us an Apache Java Web Service.
I have to connect to that web service using C#. I use Http Web Request to do that ?
Doesn't the webservice expose some WSDL? (Now, I'm really rusty on web services, I have to admit) Isn't it possible to get Visual Studio to generate a proxy class you can used based on the WSDL? (Thus saving you from having to generate your own code)
|
|
|
|
|
Hello..
I am using datagrid in a form and i want to open a new window on click event of edit button. and show some data in new window from database.
how to open new window and and show data in new window?........
|
|
|
|
|
you can use java script for that !!!
|
|
|
|
|
Actually i want to know javascript function. which function i will use for do this work.
|
|
|
|
|
in the onClick Event
window.open("YourASPX.asx")
Check this link
JAVA SCRIPT [^]
if any problem ask me !!!!
|
|
|
|
|
how i can give more than one datacolumns to the dropdown field
|
|
|
|
|
You will have to do it on the database side.
SELECT Col1 + ' ' + Col2 as Column FROM Table
When I googled, I found something:
http://easylistbox.com/home.aspx[^]
Can try this.
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
We need Tech. support in ASP.NET 2.0.
We are developing an alumni portal for our college in ASP.NET 2.0.
We are facing session management problem in our website. We have given an individual session management for alumni people in the site.
Whenever i try to login to the individual session area by providing the right username and password, the session has been immediately terminated and exited from that area with the message of session timed out.
But locally its working normal. I dont know that whether the problem is on the remote server itself or in our web.config file itself.
Here bellow i have given the web.config setting we are using:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=SSPI;Initial Catalog=jorya_aspnetdb" />
<add name="sona_alumniConStr" connectionString="server=ipaddress;user id=username;pwd=****;database=sona"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<identity impersonate="true"/>
<authorization>
<allow users="*"/>
</authorization>
<pages enableEventValidation="false" viewStateEncryptionMode="Never"/>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<compilation debug="false">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
</compilation>
<authentication mode="Windows"/>
<customErrors mode="Off" />
<httpRuntime enableKernelOutputCache="false"/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.0:42424"
sqlConnectionString="Data Source=127.0.0.0;
user id=username;pwd=*****;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
One more thing we are checking the individual session user by the following code in each page of that session. the code is below:
<%
if (!(Session["Uname"].Equals(null) || Session["Uname"].Equals("")))
{
%>
Html Statements to display the page.
<%
}
else
{
Response.Redirect(@"..\esctlogin.aspx?alert=Unknown User or Session Timed Out. Try again..");
}
%>
If there is any changes should be made in web.config file, pls inform me.
we are facing this problem since 3months.
we need solution to this.... so pls help me to solve this. pls forward this to your friends to find any solutions.
Thank you for your co-operation and i lookforward to here from you.
Thanks and Regards,
r mohan.
|
|
|
|
|
This is not a tech support company but a free community.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi Dears,
I have using my UserControl inside an updatePanel.
When I build my site on my pc everythings is ok. but when I want to publish website an error occures with this message:
"Cannot create an object of 'System.Int32' from its string representation 'MyUsrCntrl' for the ID property."
I realy don`t know what the problem is...
thx 4 yr Help!
www.behzadi.net
|
|
|
|
|
is this problem related to date time issue !!! just let me know this
|
|
|
|
|
iam looping the datatable in loop is this kills the speed of the application?iam assinging this datatabele to the grid view can i loop the grid view for my application
|
|
|
|
|
jagadeeshkumar2106 wrote: iam looping the datatable in loop is this kills the speed of the application?
If your dataset is too large, it might kill the speed of app. Why don't you just bind the gridview instead of looping through ..
modified on Monday, December 31, 2007 4:01:04 AM
|
|
|
|
|
jagadeeshkumar2106 wrote: iam looping the datatable in loop is this kills the speed of the application?
Filling datatable is costly, usually when you loop through high volume data, application will become slower. This will happen with datatable too. If you need forward only movement, better use DataReader. They are faster.
|
|
|
|
|
sir u mean instead datatable to check in loop i have to use datareader
|
|
|
|
|
jagadeeshkumar2106 wrote: i have to use datareader
It would be bit faster. BTW, what is the need to loop through each data ?
|
|
|
|
|
I display the data from database in gridview after that i click the row it will display the particular data for every 5 minutes in detailsview.please give us the article
|
|
|
|
|
You can probably reply to the previous thread that you have made. Plus, there are some replies for your questions. You should reply those questions without posting new thread..
|
|
|
|
|
use AJAX Timer Control for that
|
|
|
|