|
Its not linked with a gridview or anything as an item template, that part i can do.
Basically what i want is that there is a list of records in a listbox. You then can select a record which will then close the listbox and populate some labels with the persons email, name etc.
This is so that I can easily pull these records as I will want to add these into the database as it is part of a wizard form i am building for people to fill in.
Hope this makes sense.
Thanks
Adam
|
|
|
|
|
Hi
There are lots of examples for form view using SQL Data Source. Here is an example to bind data in labels using VS.Net 2005 (C#.net 2.0)
Simply drag and drop SQL Data source in your application. Right click the Data source, click Configure Data Source. If this is the first time you are connecting to Database then Click New connection, Type Server Name, User Name & Password. Select database from the list after entering valid user name and password.
Connection String will be populated automatically in the list. Click next, select table from the list. You can modify your query later using the SELECT property of SQLDataSource.
If you don’t want SQLDatasource, you can add a connection string in Web.config and use the same. No need to worry about that now. You need to explore more on this.
For beginners, use SQL Data source. Try without DataSource later as most applications use Stored Procedures.
Now add Form or Details or Grid view in your application; go to DataSourceID property of the control (formview or detailsview or gridview). Select DataSourceID from the list as you have added in your application.
By default all fields will be bind automatically.
Just take a note: .net uses the following expression for binding text:
1. <%# DataBinder.Eval(Container.DataItem,"columnname"%> - for gridview
2. <%# Bind("Columnname") %> - for formview or detailsview
3. <%# Eval("Columnname") %> - for formview or detailsview
Try other controls like GridView. All the best
Rate this message. Thank you. Harini
|
|
|
|
|
Thanks for your reply.
BUt i wasnt looking to have the records in a form/details view as this would cause me problems on submitting the data as how would i find the actual labels within the controls when i want to submit the form?
|
|
|
|
|
Very simple e.g.,
<br />
myLabel.text = dataTable.Rows(0).Items(0)
It depends on what your datasource is...
|
|
|
|
|
Its a sqldatasource. What code would i need in to create the datatable from this in the first place?
Thanks
|
|
|
|
|
i have a grid view with a template columns .. i put a button in one of the template column .. i want put the data in the first cell of the selected row in a string when i click on the button .. how ??
|
|
|
|
|
This is the perfect link for your question. Check out!
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx
Gautham
|
|
|
|
|
i want to create a datatable from FileInfoCollection object .Can you help me out .
|
|
|
|
|
hai friends,
I already used cookies to transfer the value from one Webform to other.But in session concept it didn't work properly.
webform1
---------
session["session_name"]=100;
webform2
---------
int x;
x=session["session_name"];
The Session example of above is right?
if it wrong means? plz give the solution.
m.s.senthil kumar
|
|
|
|
|
int x;
x=(int)session["session_name"];
or
x=Convert.ToInt32(session["session_name"]);
|
|
|
|
|
How can i send an emailmesssage from my webform
|
|
|
|
|
It's very easy to send and receve email in asp 2.0
first include following files in ur code filed
1)Imports System.Web.Mail
2)Imports System.Net
You can send mail in following way
' Creating the Mail Message
Dim objMailMessage As MailMessage
objMailMessage = New MailMessage
objMailMessage.From = "youremailaddress@yahoo.com"
objMailMessage.To = custemail.ToString
objMailMessage.Subject = "Subject Heading"
objMailMessage.Body = "Thank you (any Description in body)"
objMailMessage.BodyFormat = MailFormat.Html
' Sending Mail Message
SmtpMail.Send(objMailMessage)
'And also set ur Web.config file by defining your network host ipaddress, username and password
Regards,
Vidhin Shah
|
|
|
|
|
where and how i will define in web config my network host ip address,username and password.
|
|
|
|
|
<system.net>
<mailsettings>
<smtp from="youremail@yahoo.com">
<network host="xxx.xxx.xxx.xxx" password="abc" username="xyz">
(your network host ip address and username and password)
|
|
|
|
|
in webconfig file how i will define that.can u send that coding
|
|
|
|
|
my code is like this
MailMessage mail=new MailMessage();
mail.To ="anu@gmail.com";
mail.From ="anu2@gmail.com";
mail.Subject = "your subject";
mail.Body = "your subject";
SmtpMail.Send(mail);
it's executing.but i am not getting msg in my mail?what is the problem
|
|
|
|
|
hi i tried to paste the code but i dont know why its not displaying here so i have mailed the code to ur email address. so read that code and copy paste that code in ur web.config file
Regards,
Vidhin Shah
|
|
|
|
|
i didn't get mail in my email why?..............
|
|
|
|
|
|
Any body give the small example program(free from errors) for authentication and authorization ?plz...
m.s.senthil kumar
|
|
|
|
|
Hello I have multiple Command Fields in my grid view and I want to perform different functions on both command fields. so how can I identify that which specific command fields is selected ???
If Any one have any idea about this then please reply me as early as possible.
Thanks in Advance
-- modified at 4:37 Thursday 1st March, 2007
|
|
|
|
|
Set CommandName or CommandArgument property of the Command Fields.
Regards,
Mark
|
|
|
|
|
Hai,
I want a solution to update the datas in the grid directly in asp.net(c#)
,if anybody having sample coding or examples ,please post it .
m.s.senthil kumar
|
|
|
|
|
Use dataset.update method
Thomas
|
|
|
|
|
Hai Friends ,i havea doubt in implementing the master pages ,i red the articles through the google search but unable to execute without error.
please tell me clearly about the implementation.
m.s.senthil kumar
|
|
|
|