Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:638499
More Search Options
RSS Available
Matching Posts
Re: how to do update in LINQ
updateDataContext.tblCust.Where(c => c.Name.Equals( "John" ));
Posted to
Data Access and ObjectDataSource Control
(Forum)
by
ecbruck
on 9/2/2009
Re: how do i remove the time from the DateTime property
[quote user="kipo"] You can try with this: view plain copy to clipboard print ? public DateTime Date { get { return Convert.ToDateTime(txtDate.Text).ToString( "d" ); } } public DateTime Date { get { return Convert.ToDateTime(txtDate.Text).ToString("d"); } } Instead of "d", you can use a lot of different patterns - here is a collection of them: http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm [/quote] In order to do this, you must change
Posted to
Web Forms
(Forum)
by
ecbruck
on 9/2/2009
Re: get drop down values in gridview
Do something like this: protected void btnSave_Click(object sender, EventArgs e) { foreach (GridViewRow row in GridView1.Rows) { DropDownList ddl = row.FindControl("DropDownList1") as DropDownList; if (ddl != null) { string value = ddl.SelectedValue; // Save to db here } } }
Posted to
Data Presentation Controls
(Forum)
by
ecbruck
on 9/2/2009
Re: Using dr.ItemArray with Column Names?
Sure, try this: foreach (DataRow dr in dt.Rows) { listedEmail = dr["Email"].ToString(); title = dr["Title"].ToString(); }
Posted to
Data Presentation Controls
(Forum)
by
ecbruck
on 9/2/2009
Re: get drop down values in gridview
Try this: protected void btnSave_Click(object sender, EventArgs e) { List<string> values = new List<string>(); foreach (GridViewRow row in GridView1.Rows) { DropDownList ddl = row.FindControl("DropDownList1") as DropDownList; if (ddl != null) { values.Add(ddl.SelectedValue); } } string value = String.Join(",", values.ToArray()); }
Posted to
Data Presentation Controls
(Forum)
by
ecbruck
on 9/2/2009
Re: how do i remove the time from the DateTime property
[quote user="young345"] i tried this but i get an error saying 'Cannot implicitly convert type 'string' to 'System.DateTime' do you knwo what that means? and how i can resolve it thank you [/quote] As I stated in my previous post, you can NOT return a String for a DateTime property. You MUST either change the type of your property to a String or modify the DateTime value AFTER the property is currently called.
Posted to
Web Forms
(Forum)
by
ecbruck
on 9/2/2009
Re: how do i remove the time from the DateTime property
The Date property will only ever return a DateTime which will contain the full date/time. You must either use this property and convert to a formatted string or you could always add another readable property like this: public DateTime Date { get { return Convert.ToDateTime(txtDate.Text); } } public string ReadableDate { get { return this.Date.ToShortDateString(); } }
Posted to
Web Forms
(Forum)
by
ecbruck
on 9/2/2009
Re: Object reference not set to an instance of an object
Is your row really selected? Is the Cells[2] reference valid? I'd personally fire up the debugger and set a breakpoint within your code. Then, I'd check to see what is coming back as null. At that point, you can then decide what to do.
Posted to
Getting Started
(Forum)
by
ecbruck
on 9/1/2009
Re: Convert VB to C#
Thanks for the reminder. I always get those mixed up.
Posted to
C#
(Forum)
by
ecbruck
on 9/1/2009
Re: Grid and DropDownList question
If you've placed the name of your ID field into the GridView.DataKeyNames property, then you can retrieve it something like this: Protected Sub gvEvalList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim ddl As DropDownList = DirectCast(sender, DropDownList) Dim gvr As GridViewRow = TryCast(ddl.NamingContainer, GridViewRow) If Not gvr Is Nothing Then Dim id As String = GridView1.DataKeys(gvr.RowIndex)("ID").ToString End If End Sub
Posted to
Web Forms
(Forum)
by
ecbruck
on 9/1/2009
Page 1 of 914 (9138 items) 1
2
3
4
5
Next >
...
Last »
ASP.NET:
Silverlight and RIA Services: Implementing Search
Channel 9:
C9 Lectures: Brian Beckman - Covariance and Contravariance in Physics 1 of 1
Channel 9:
Set Your Data Free
Channel 9:
Implementing a Silverlight SharePoint WebPart with Visual Studio 2010
WindowsClient:
New WPF Showcase Addition: Enterprise
Channel 9:
Reactive Extensions API in depth: Contract
WindowsClient:
Concluding "New WPF Features" Series
WindowsClient:
Introduction to TestApi – Part 5: Managed Code Fault Injection APIs
ASP.NET:
T4MVC now has a real home and a dedicated forum!
TechNet Edge:
Windows Server 2008 R2 : New Power Management Features
ASP.NET:
Web Deployment Painkillers: VS 2010 & MS Deploy
WindowsClient:
Application Accessibility Testing
WindowsClient:
Prism & WCF RIA Services
Channel 9:
Sharepoint 2010 and Claims-Based Identity
WindowsClient:
IRhetoric Ported To BlogEngine.NET
WindowsClient:
PDC Recap and More
Channel 9:
Reactive Extensions API in depth: Primitives
WindowsClient:
New WPF Features: MultiTouch
WindowsClient:
codeplex.com/testapi v 0.4 available
Channel 9:
The Visual Studio Documentary - Alan Cooper, the Father of Visual Basic
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online