I have a querry that will add data to a temp table for a period given the begin date and end date, for each month that there is data i need to have a column, which i did with :
Sum
(case when Month([Date])=1 then
View Complete Post
with the sql statement below, i try to select the records based on the selected date, it return no rows from adapter filled datatable.
however, when i run the query in sql query in sql server studio management, it returns records.
date format = 09/28/2010
string[] splitDT = txtSelectedDate.Text.Split('/'); string strRearrangeDT = splitDT[0] + "/" + splitDT[1] + "/" + splitDT[2]; using (SqlConnection sqlconn = new SqlConnection(connstring)) { DataTable dt = new DataTable(); string strSQL = "SELECT userclaim_details3.id, userclaim_details3.userclaimid, userclaim_details3.userid, userclaim_details3.childcategorytableid, userclaim_details3.statusid, " + "userclaim_details3.amount AS amountname, userclaim_details3.remark AS remarkname, userclaim_details3.datecreated AS datecreatedname, " + "userclaim_details3.datemodified, approvaltable.id AS Expr1, approvaltable.typename AS statusname, usertable2.id AS Expr2, usertable2.name AS uname, " + "childcategorytable.id AS Expr3, childcategorytable.categor
I need to select records in my database based on todays date. I have a date field that saves a future scheduled ship date for orders and need to use a select statement that would use todays date as a parameter. I am able to do this by manualy entering the date in the select statement but when I use todays date with inline code in the select statement it does not work. Please look at the code segment below:
<%Dim strTodaysDate As StringstrTodaysDate = "'" + Date.Now.AddDays(9).ToString("MM/dd/yyyy") + "'"%>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DAVINCIORDERTRACKINGConnectionString %>" SelectCommand="SELECT * FROM [OrderTracker] WHERE (CONVERT(char(10), ScheduledShipDate, 101) <> '<% =strTodaysDate %>')"> </asp:SqlDataSource>
The segment above returns all records. And if I just enter the date manually in the select statement like below it returns the correct records:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DAVINCIORDERTRACKINGConnectionString %>"
I want to create a new table to sql database at runtime. The column names would be "Name", "Date", "Event". I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files.
For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"
I also would like that table name to be name dynamically from the textbox Name when the user enters the information.
I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!
Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master") objConn.Open()
Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")
objConn.Open()
On New Item form, select item on choice dropdown based on query result. I posted this on Experts Exchange awhile back with no answer, so here's hoping someone here has an idea :) So I've mostly figured this problem out, but I need some help in getting over the hump... note that I'm using JavaScript to do this (SPServices) on SharePoint 07'. I'm on the New Items page of a list. Based on a user's selection in a "Teacher" dropdown, I'm doing the following: 1.) Get the value of the Teacher field and several other fields (School and Visit Date) 2.) Run a CAML query based on those fields to find the last list item entered for that Teacher So here's where I'm stuck... I have 10 choice fields, all with choices 0, 4, 7, and 10. Depending on what they were set to in the last entered item (which I queried), I want to set the selected item on each of those dropdowns to equal that. So "Score 1" was set to "4" on the la
I posted this on Experts Exchange awhile back with no answer, so here's hoping someone here has an idea :)
So I've mostly figured this problem out, but I need some help in getting over the hump... note that I'm using JavaScript to do this (SPServices) on SharePoint 07'. I'm on the New Items page of a list. Based on a user's selection in a "Teacher" dropdown, I'm doing the following: 1.) Get the value of the Teacher field and several other fields (School and Visit Date) 2.) Run a CAML query based on those fields to find the last list item entered for that Teacher So here's where I'm stuck... I have 10 choice fields, all with choices 0, 4, 7, and 10. Depending on what they were set to in the last entered item (which I queried), I want to set the selected item on each of those dropdowns to equal that. So "Score 1" was set to "4" on the la
I have a gridview, based on thsi datasource:
<asp:SqlDataSource ID="SqlDataSourceAllLoads" runat="server" ConnectionString="<%$ ConnectionStrings:tplatz_dk_dbConnectionString %>" SelectCommand="SELECT DISTINCT DATEADD(day, 0, DATEDIFF(day, 0, tblDelivered.delivered_Date)) AS delivered_Date, tblDelivered.delivered_LoadNo, tblDelivered.delivered_TrailerNo, ISNULL(tblDeliveredInfo.deliveryInfo_FirmaNavn, N'?') AS Expr1 FROM tblDelivered FULL OUTER JOIN tblDeliveredInfo ON tblDelivered.delivered_LoadNo = tblDeliveredInfo.deliveryInfo_LoadNr ORDER BY delivered_Date DESC"> </asp:SqlDataSource>
Using a dropdownlist, I can filter (by changing datasource) the results based on customer names in a dropdownlist. This datasource, working perfectly, looks like this:
<asp:SqlDataSource ID="sqldataSourceKundeLoads" runat="server" ConnectionString="<%$ ConnectionStrings:tplatz_dk_dbConnectionString %>" SelectCommand="SELECT DATEADD(day, 0, DATEDIFF(day, 0, tblDelivered.delivered_Date)) AS delivered_Date, tblDelivered.delivered_LoadNo, tblDelivered.delivered_TrailerNo, ISNULL(tblDeliveredInfo.deliveryInfo_FirmaNavn, N'?
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend