|
I have a table tbUsers and I selected a row now it has three fields. I want value of first field in txtbox1, second field value in textbox2 and third field value in textbox3. where textbox1, textbox2 and textbox3 are the textboxes in my ASP page.
How can I do that.
Thanks,
|
|
|
|
|
IMO, you first should know how to get data thru ADO.NET...do a search from uncle Google for ADO.NET tutorial...
<< >>
|
|
|
|
|
I have a web service I have been working on. I added a new method to the service, got it all working on my machine and copied it to a Windows 2000 server for some more testing. It is now throwing null reference exceptions any time my client code calls the methods in it through the object proxies.
This service was running fine on the server until this elevation and still runs fine on my machine. I have checked the event log and its got nothing, and I can view the service through IE, browse the WSDL, etc. so IIS is serving it fine. Since the input and output are complex types I can't call it through IE, though. I have tried the usual web reference update, iisreset, so forth. So far nothing is making this thing work.
This is a new one to me. Anyone come across this one before?
Here is the stack trace:
Object reference not set to an instance of an object. ---> Object reference not set to an instance of an object.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at WebserviceTester.CASE2SOAP.Service.SubmitAlchemistRequest(AlchemistRequestObject Request)
at WebserviceTester.Form1.btnTestCreateAlcReqWS_Click(Object sender, EventArgs e)
|
|
|
|
|
I needed to implement a custom MembershipProvider cuz we already have a database with user information in it; also I need to get a list of users. In my DAL I have a method that I can call which will populate the business entity and returh a List<>. However since I am using MembershipProvider I thought I should use the Memebership.GetAllUsers() method to do the same.
Do you think that the following implementation is acceptable or is it a programming NO NO...?
<font size="2"><FONT size=2> public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)</FONT>
{
<FONT size=2> List<UsersEntity> users = DAL.GetUsers();</FONT>
<FONT size=2> foreach(UserEntity user in users)</FONT>
{
<FONT color=#008080 size=2> MembershipUser</FONT><FONT size=2> members = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>MembershipUser(</FONT><FONT size=2><SPAN style="COLOR: blue">this</SPAN>.Name,
user.username,
user.providerUserKey,<FONT color=#008080 size=2></FONT>
user.email,
user.passwordQuestion,
user.comment,<FONT color=#008080 size=2></FONT>
user.isApproved,<FONT color=#008080 size=2></FONT>
user.isLockedOut,
user.creationDate,
user.lastLoginDate,
user.lastActivityDate,
user.lastPasswordChangedDate,
user.lastLockedOutDate<FONT color=#008080 size=2></FONT>);
</FONT><FONT size=2></font>
}
} Can you tell me what I need to to do about the fields that I donot have in my database? Do I need to update the database? or should I just pass in a null or String.Empty or something like that? Please help.
|
|
|
|
|
Hi,
you can provide any value to the fields to the Fields that u dont have in your database or you can leave them blank by assigning null or string.empty or any default value.
But be sure that you r not going to use these fields anywhere in your application.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
i have problem, I want to add control at runtime like two checkBox . when i checked first then enable false of second checkedbox. if any friend have answer then send me mail or post message.
Thanks
sujitvns4u@gmail.com
Sujit
|
|
|
|
|
Hi,
Add the controns in design view and hide the second. On the firsts, activate the AutoPostBack property and on the Page_Load change the visibility of the second checking the checked value of the first.
|
|
|
|
|
i think he meaned to create the controls at run time on demand.
|
|
|
|
|
Dear friend my question was that i'm adding control at run time not design time then how to handle event of this control.
Thanks for reply
Sujit
|
|
|
|
|
Check this out and please reply me....
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CheckBox c1 = new CheckBox();
CheckBox c2 = new CheckBox();
c1.ID = "C1";
c2.ID = "C2";
c1.AutoPostBack = true;
c2.AutoPostBack = true;
Page.Form.Controls.Add(c1); //or Panel1.Controls.Add(c1);
Page.Form.Controls.Add(c2); //or Panel1.Controls.Add(c2);
c1.CheckedChanged += new EventHandler(c1_CheckedChanged);
}
private void c1_CheckedChanged(object sender, EventArgs e)
{
if (((CheckBox)Page.Form.FindControl("C1")).Checked) //Or Panel1.FindControl("C1")
{
((CheckBox)Page.Form.FindControl("C2")).Enabled = false;
}
else
{
((CheckBox)Page.Form.FindControl("C2")).Enabled = true ;
}
}
}
|
|
|
|
|
I have a problem.
I Fill a form and on button click event i just want to enter all values on the form, in database and form this database i take entire data and bind it to datagrid which is in other web page.
is it possible and how i do it.........
|
|
|
|
|
Ajeet mittal wrote: I have a problem
So what is the problem when you do that?
<< >>
|
|
|
|
|
Ajeet mittal wrote: Asp.Net Problem
Wow - not an ASP.NET problem ? Here in the ASP.NET forum ? ( in other words, not a good choice for a header )
Ajeet mittal wrote: is it possible and how i do it.........
Yes, it's possible. Any book on ASP.NET should give you the info you would need to at least try to do this. If, when you've done that, you're still stuck, let us know what you tried, and we'd love to help. As it stands, your question is so vague that the only way to answer it is to create a DB and a project with two pages, and write it for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi,
yes its possible n its easy. due to lack of time i m not going to write the code but if u need send me email at "kabhi__kabhi@hotmail.com" i'll send u code. anyways
do one thing,
O-O on click event of the form, save your data in the database n put an id, or value in session using "Session("DesiredValue")=txtDesiredvalue.text", which can be used to fetch data (e.g. id, name, father etc.). after words on the next page call tht value using "lblDesiredVal.Text=Session("DesiredValue")".
now use this lblDesiredval in ur query to select data from database while making data adapter.n make dataset,define datasource of the datagrid,datamember and in the last, bind id. thts it. Cake is Prepared.
Hope It Works.
Regards.
Atif Ali Bhatti.
|
|
|
|
|
I have a problem. I have two dropdown lists in my web page. named ddlApplication and ddlPermission and I have a button. I have two items in each dropdown list but when I choose second item and click on button and debug by using
these lines of code it always gives me value of first item. How should I fix this problem.
string str2 = this.ddlApplication.SelectedItem.Text;
string str3 = this.ddlPermission.SelectedItem.Text;
hahii
|
|
|
|
|
This is solution for you Check it on your system
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DropDownList1.SelectedIndex = 0;
DropDownList2.SelectedIndex = 0;
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(DropDownList1.SelectedValue);
Response.Write(DropDownList2.SelectedValue);
}
Sujit
|
|
|
|
|
I've got a site using the default membership provider, works great. Need to store additional information like first name and last name AND have it available to all users. What's the best way (and the easiest way) to do that?
Example-
I have approximately 250 users set up on my site. Need to be able to display a full user list to all these users on demand, but rather than displaying the username, I want to show users by Last Name, First Name and Department/Location.
|
|
|
|
|
hey guys ,
i am using multiveiew control for two seperate form where i am placed textbox and button controls in the separate table.
i am allowing the users to view only one form at a time with the help of activeviewindex property,in that am using autopostback property for one of the textbox,while running the application
i got the exception error that is "javascript runtime error objects or property does not support" like that so guys i want
ur advise for the above
thanks
prabhu
coding makes me interesting in dot net
|
|
|
|
|
Hi!
I'm trying to export an ASP.NET table control to Excel. But the Excel document is empty.
My code is (tblCommission is the ASP.NET table):
Response.Clear();<br />
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");<br />
Response.Charset = "";<br />
Response.Cache.SetCacheability(HttpCacheability.NoCache);<br />
Response.ContentType = "application/vnd.xls";<br />
System.IO.StringWriter stringWrite = new System.IO.StringWriter();<br />
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);<br />
tblCommission.RenderControl(htmlWrite);<br />
Response.Write(stringWrite.ToString());<br />
Response.End();<br />
Why is the Excel document empty? Any help or info is greatly appreciated; so far Google hasn't helped me so I hope some of you can.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Not sure what this code is trying to achieve...you seem to think that RenderContol will somehow know the format of an excel document?!?!?
In order to export to excel, you'd need to hook into the excel object nodel, and iterate through the table's rows / cells collection, setting values in appropriate cells in the XLS, then send the resulting document down the wire...
(apologies if I've missed the subtlety of your code above!)
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
Thanks for your answer. Well, I was working with an MS article as basis (How To Export Data in a DataGrid on an ASP . NET WebForm to Microsoft Excel[^]), but I must have misunderstood something somewhere.
I don't assume that the RenderControl knows the Excel format, I simply assume that I extract the HTML and get Excel to show it in a workbook.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Hi all.
I need help creating discussion forum threads as the ones here in code project.
A set of questions will be posted on a site. A user will login and post a reply to the question and submit it. The reply should immediately show as a branch off from the question. In turn, replies can also have sub replies and should show as a sub branch from the previous reply.
I need help with this in c#(asp.net)please. Any URL's,documentation,source code,etc will be of great help.
thanks
Marquin
|
|
|
|
|
Search RiversideInternetForum project here...that's great in ASP.NET,C#
<< >>
|
|
|
|
|
i wanna know how to use open file dialog control in C# aps.net web application.as i have to save the downloading attachment file on my system through my application. i want help in C# coding instead Asp.I m using Vstudio 2003
Thanx
|
|
|
|
|
Do you mean you want to show open/save dialog in web application as windows form application??
<< >>
|
|
|
|