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:699298
More Search Options
RSS Available
Matching Posts
Re: Colum values depending in another column
It's finally working... this is the code: 1 Public Class Test 2 Private myConnStr As String = "data source=(local); integrated security=SSPI; initial catalog=CMI" 3 4 Public Function MakeDataTable( ByVal doc As Integer , ByVal thisDate As Date ) As DataTable 5 ' Using 6 Dim connection As SqlConnection = New SqlConnection(myConnStr) 7 Try 8 Dim Query As String = "SELECT horainicio FROM [Modulo] WHERE idespecialidadmedico=@doc and iddia=@iddia" 9 Dim command As SqlCommand = New SqlCommand(Query, connection
Posted to
Data Presentation Controls
(Forum)
by
Saintcorp
on 12/27/2006
Re: Colum values depending in another column
I made the changes, but I think I've found the error. It was in the query :) Since the SQL server uses only datetime types, one have to split the component of it So, this query: SELECT * FROM [RESERVA] WHERE idespecialidadmedico=1 AND fechareserva=@Date AND hireserva=@Hour Becomes: SELECT * FROM [RESERVA] WHERE idespecialidadmedico=1 AND fechareserva=@Date AND hireserva - CAST (FLOOR( CAST (hireserva AS float )) AS datetime ) =@Hour Now it works.... but I'm not done yet ;) Thanks a lot!!!!!!
Posted to
Data Presentation Controls
(Forum)
by
Saintcorp
on 12/26/2006
Re: Colum values depending in another column
1 Public Class Test 2 Private myConnStr As String = "data source=(local); integrated security=SSPI; initial catalog=CMI" 3 4 Public Function MakeDataTable( ByVal doc As Integer , ByVal thisDate As DateTime) As DataTable 5 ' Using 6 Dim connection As SqlConnection = New SqlConnection(myConnStr) 7 Try 8 Dim Query As String = "SELECT horainicio FROM [Modulo] WHERE idespecialidadmedico=@doc and iddia=@iddia" 9 Dim command As SqlCommand = New SqlCommand(Query, connection) 10 command.CommandType = CommandType
Posted to
Data Presentation Controls
(Forum)
by
Saintcorp
on 12/26/2006
Re: Colum values depending in another column
Forget about the 20 and 22 line :P
Posted to
Data Presentation Controls
(Forum)
by
Saintcorp
on 12/26/2006
Re: Colum values depending in another column
1 Public Class Test 2 Private myConnStr As String = "data source=(local); integrated security=SSPI; initial catalog=CMI" 3 4 Public Function MakeDataTable( ByVal doc As Integer , ByVal thisDate As String ) As DataTable 5 ' Using 6 Dim connection As SqlConnection = New SqlConnection(myConnStr) 7 Try 8 Dim Query As String = "SELECT horainicio FROM [Modulo] WHERE idespecialidadmedico=@doc" 9 Dim command As SqlCommand = New SqlCommand(Query, connection) 10 command.CommandType = CommandType.Text 11 command
Posted to
Data Presentation Controls
(Forum)
by
Saintcorp
on 12/26/2006
Re: Colum values depending in another column
I was looking up the code and I get an error on if (IsReserved(doc, reader["Hour"].ToString(), thisDate)) { dt.Rows.Add(new Object[] { reader["Hour"].ToString(), "Reserved" }); It says something about "Make sure that the maximum index on a list is less than the list size".
Posted to
Data Presentation Controls
(Forum)
by
Saintcorp
on 12/25/2006
Re: Colum values depending in another column
I appreciate your help very much, but I still can't see a solution :( Let's see.... I have two tables: Modules and Reservation In MODULE I have every module from a doctor with the day and the hours that he goes to work, for example: doctor | module | hour | day -------------------------------------------- 1 1 10:00 1 1 2 10:30 1 1 3 11:00 1 1 4 09:00 2 1 5 09:30 2 This says that the Doctor 1 works from 10:00 until 11:00 on Monday, from 9 to 9:30 on Tuesday And in RESERVATION I got: date | hour |
Posted to
Data Presentation Controls
(Forum)
by
Saintcorp
on 12/24/2006
Colum values depending in another column
I'm doing a little reservation grid and I need two columns In the first one I got the hours and in the second one I got the 'state' For example: HOUR | STATE ------------------------- 10:00 | Available 10:30 | Reserved 11:00 | Reserved 11:30 | Available The problem is that I fill this gridview from differents tables in my BD. So, the only way I can make this is binding the state items while the gridview is being generated, do I explain myself? But, I don't know how to do this :S In this tutorial
Posted to
Data Presentation Controls
(Forum)
by
Saintcorp
on 12/23/2006
Filed under: gridview custom column data items
Page 1 of 1 (8 items)
Channel 9:
TWC9: 2009 - The Year in Review
ASP.NET:
Tip#100: Did you know… How to view ASP.NET trace information?
ASP.NET:
Passing anonymous objects to MVC views and accessing them using dynamic
Channel 9:
Channel 9 Live at PDC09: Coding 4 Fun
Channel 9:
Channel 9 Live at PDC09: Stephen Toub
WindowsClient:
Mouse Gestures for Internet Explorer
Channel 9:
Controlling concurrency in Rx
Channel 9:
Dev Tools Ecosystem Summit Videos Available
WindowsClient:
Using Cerebrata's Cloud Storage Studio To Download IIS logs from Multiple Instances of Windows Azure
TechNet Edge:
TechNet Radio: Office 2007 Setup and Configuration (Part 1)
Channel 10:
How-To: Listen to Your Zune Pass Music on Your WinMo Phone
Channel 10:
Share Your Screen with SharedView
Channel 10:
Get Microsoft Tinker Game For Free
Channel 10:
LG eXpo WinMo 6.5 Unboxing Video
Channel 9:
ADFS 2.0 RC is Here!
Channel 10:
Bing Reference Updated with New Sidebar Features
Channel 10:
Look Behind SurfaceScapes
ASP.NET:
Moving your ASP.NET Application to Windows Azure – Part I
TechNet Edge:
Windows Server 2008 R2 Quick Look- Installing the Migration Tools
WindowsClient:
My latest videos – WPF, Silverlight, Sensors, and PDC09
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online