I have a couple fields in an Access DB that have parenthesis in the name: EST(Minutes), EST(Seconds) When I try and populate the dataset and then bind the datagrid it claims there is no field having that name.. Can parenthesis be used in fieldnames? If so, can you please tell me the correct syntax please? thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
cavall
Posts
-
fields with parenthesis in name will not populate dataset -
html code built from queried dataset not formatting correctI have built a page with css style layout. for the content div of the page I populate a dataset from an access database. I then have a string variable which i set to equal all the entries from the dataset. I then populate a label with that string (which has html tags in it) to build the page content. My problem is twofold: A) the html tags I use are
and
tags. I want it to build like this (its displaying News entries):
Title Author: Joe Smith Date: 1/1/05
Whatever the message is should go here
Currently there are around 4 entries. The first 3 entries display with the correct layout, but the 4th entry
is left aligned instead of indented like the others. If I add an entry to the beginning of the list (total of 5), then the 2nd entry
is left aligned and the rest are correct. If I add an entry to the end of the list (total of 5), then the 4th entry
is still left aligned and the rest are fine. Here is my CSS for
and
: h2 { font-family:Agency FB; font-size:larger; margin:5px 5px 5px 5px; padding:5px 0; } p { margin:0; padding:10px 20px 10px 20px; font-family:Agency FB; text-align:left; } p:first-letter { font-family:Agency FB; font-size: 80%; font-weight: bold; color:blue; } Next problem: B) the access database im pulling from has a memo field, which I am populating into the dataset and then trying to display as the message in the above manner. Only part of the entire memo field is being populated into the dataset, hence the message is only partially displayed. Is there a restriction on the size or type of data that can be pulled from the db and populated into the dataset? Thanks so much for the help!! Cavall ps - here is the complete html code taken from one of the examples of my A) problem:
May Meeting - May 12, 2005, 7pm, Gary's Dad's Restaurant Author: Eugene Date: 05/12/2005
7pm Gary's Dad's Restaurant (Cost $10 per person, includes the following, Salad and bread, Pasta, red sauce or alfredo sauce, and grilled chicken. If you would like to order off the menu you may.) Speaker: Gary - Aero position and general bike info. Also
JTA Members Place in Louisiana Triathlon Author: William Barnett Date: 04/26/2005
Eugene O'Donnell placed 2nd in his age group, John Noblin finished 6th overall and 3rd in his age group, Larkin Carter finished 5th in his age group, Wayne Jimenez finished 3rd in his age group and I finished 3rd in my age group.
-
site templating...how?I was wondering if there is a way in VS.net to setup site templates similar to how you accomplish this in Dreamweaver, for example, so that you could make changes to one page that would propegate to the other pages of the site as well... Anyone know how to do this??? I actually tried setting templates up in Dreamweaver and then doing my dynamic code in VS.net, but when I made changes in VS.net and tried to go back to Dreamweaver and make changes to the template, i get errors.... Thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
site templating... how?I was wondering if there is a way in VS.net to setup site templates similar to how you accomplish this in Dreamweaver, for example, so that you could make changes to one page that would propegate to the other pages of the site as well... Anyone know how to do this??? I actually tried setting templates up in Dreamweaver and then doing my dynamic code in VS.net, but when I made changes in VS.net and tried to go back to Dreamweaver and make changes to the template, i get errors.... Thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
Datarelation Help... data into a dataset and binding to a datagrid?!?I am trying to work with datarelations to populate a datagrid with the child rows from a table. The only examples I can find online only show how to Console.writeline the results as opposed to using the GetChildRows to populate a dataset table (or something else) and then bind that to a datagrid... Is this even possible? And, if so... can someone guide me in the right direction Please? Thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
Adding Ranking Column (just a column incrementing by 1 each row) to datagridis there a way around not using stored procedures? It is a lengthy process to get our DBA to create those procedures and so being able to do joins on the fly in vs.net would be awesome... do you know of a way to do this? thanks cav "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
Adding Ranking Column (just a column incrementing by 1 each row) to datagridthanks for the reply, but my main problem is this... i have another table in a dataset that I want to joing, say to that table you just created, link them on a field, and then pull the results from that join. ie. all the fields from the second table and the rank field on the first table.. the join would, for example, be on the "Name" field... Got any ideas? Thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
Adding Ranking Column (just a column incrementing by 1 each row) to datagridCan someone tell me how to make a column in a datagrid that simply puts the number of the record in its field? ie: (Rnk Column) Rnk Name 1 aaa 2 bbb 3 ccc 4 ddd Thanks Cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
connecting two datatables within a dataset and forming relation HELPI have an access Table with vendor_num and vendor_name fields. I have an oracle Table which has a vendor_num field and other fields of details. Initially, my thought was to pull the access table into a dataset and then pull the oracle table into the dataset, form a datarelation between the two, and use GetChildRows to pull the other details from the oracle table I pulled in. however... When I tried to do this I got an error b/c not all data in the child table (oracle table) had a parent... Can someone point me in the right direction into either fixing this train of thought or a new method altogether, please? Thanks Cavall Dim conn As New OdbcConnection("Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\Documents and Settings\mwaters2\My Documents\VQM\testVQM.mdb;Uid=Admin;Pwd=;") Dim da As New OdbcDataAdapter("SELECT Vendor_Num FROM Top50_test", conn) Dim ds As New DataSet da.Fill(ds, "Top50") DataGrid1.DataSource = ds.Tables("Top50") DataGrid1.DataBind() Dim conn2 As New OleDbConnection("Provider=msdaora;Data Source=VQM;User Id=***;Password=***;") Dim childSQL As String childSQL = "" & _ "SELECT vendor.vendor_num, restratificationhistory.vend_accy " & _ "FROM vendor, restratificationhistory " & _ "WHERE vendor.vendor_num = restratificationhistory.vendor_num " & _ "AND restratificationhistory.dt_tm_added Between to_date('1/1/04','MM/DD/YY') AND to_date('11/10/04','MM/DD/YY')" Dim da2 As New OleDbDataAdapter(childSQL, conn2) da2.Fill(ds, "Details") Dim parentCol As DataColumn = ds.Tables("Top50").Columns("Vendor_Num") Dim childCol As DataColumn = ds.Tables("Details").Columns("Vendor_Num") Dim dr As New DataRelation("VendorToDetails", parentCol, childCol) ds.Relations.Add(dr) "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
add custom column to dataset problem...Hi... I am trying to add a few custom columns to a dataset which will show percentages of already existing columns. The problem I am having is that in my SQL I am grouping by date and on some days there will be Zero for the number I am using as the denominator in the percentage column (the one I am adding) expression, therefore causing me to have a divide by zero error. My approach to solving this was to loop through all the rows in the dataset and if that denominator column was 0, I would add the column with no expression, otherwise I would add the column and set the expression = numer/denom*100. This does not work. I am confused... If I add the column say on the first row of the loop where the denom was 0, then on the second row of the loop the denom is a valid number, but when I try and change the column(whatever).datatype or column(whatever).expression it gives me "Object reference not set to an instance of an object" Here is the code... if anyone can help me figure out a working method for this I would GREATLY appreciate it... For x = 0 To ds.Tables("Received Total").Rows.Count - 1 Dim t, d As Integer Dim p As Decimal t = ds.Tables("Received Total").Rows(x).Item("Total ASN") d = ds.Tables("Received Total").Rows(x).Item("DARM") If t <> 0 Then p = d / t * 100 End If If ds.Tables("Received Total").Rows(x).Item("Total ASN") <> 0 Then 'Dim dcDARM As New DataColumn ds.Tables("Received Total").Columns("dcDARM").DataType = GetType(Decimal) ds.Tables("Received Total").Columns("dcDARM").ColumnName = "DARM%" ds.Tables("Received Total").Columns("dcDARM").Expression = "DARM/[Total ASN]*100" 'ds.Tables("Received Total").Columns.Add(dcDARM) Dim dcSupplierLink As New DataColumn dcSupplierLink.DataType = GetType(Decimal) dcSupplierLink.ColumnName = "Supplier Link%" dcSupplierLink.Expression = "[Supplier Link]/[Total ASN]*100" ds.Tables("Received Total").Columns.Add(dcSupplierLink) Dim dcVendor As New DataColumn dcVendor.DataType = GetType(Decimal) dcVendor.ColumnName = "Vendor%" dcVendor.Expression = "Vendor/[Total ASN]*100" ds.Tables("Received Total").Columns.Add(dcVendor) Dim dcOther As New DataColumn dcOther.DataType = GetType(Decimal) dcOther.ColumnName = "Other%" dcOther.Expression = "Other/[Total ASN]*100" ds.Tables("Received Total").Columns.Add(dcOther) Else Dim dcDARM As New DataColumn dcDARM.DataType = GetType(Decimal) dcDARM.ColumnName = "DARM%" Dim dcSupplierLink As New DataColumn Dim dcVendor As New DataColumn Dim dcOther As New DataColumn ds.Tables("Received T
-
Trying to hide specific columns in a datagrid populated by a datatable...mappingtype.hidden not working... HELPThis is my code to fill a dataset with a table... fill the datatable with that table, then hide columns in the table based on a user selected criteria in a dropdown list. I have unchecked remove columns at runtime and setup all the bound columns, but ALL of the columns still are showing instead of just the ones that are not hidden. Any help appreciated... Thanks Dim dt As DataTable da.Fill(ds, "CAPdetails") dt = ds.Tables("CAPdetails") conn.Close() Dim x As Integer Select Case drpLocation.SelectedItem.Value Case "Ankeny", "Rockford", "Green Bay" 'Only shows Carson numbers For x = 0 To (dt.Columns.Count - 1) If dt.Columns(x).ColumnName.Substring(0, 4) <> "Cars" Then dt.Columns(x).ColumnMapping = MappingType.Hidden End If Next Case "Aberdeen", "Ontario" 'Only shows FullLine and Off5th numbers For x = 0 To (dt.Columns.Count - 1) If dt.Columns(x).ColumnName.Substring(0, 4) <> "Full" Or dt.Columns(x).ColumnName.Substring(0, 4) <> "Off5" Then dt.Columns(x).ColumnMapping = MappingType.Hidden End If Next Case "Steele" 'Only shows Proffitts and Parisian numbers For x = 0 To (dt.Columns.Count - 1) If dt.Columns(x).ColumnName.Substring(0, 4) <> "Prof" Or dt.Columns(x).ColumnName.Substring(0, 4) <> "Pari" Then dt.Columns(x).ColumnMapping = MappingType.Hidden End If Next End Select dgCAPdetail.DataSource = dt dgCAPdetail.DataBind() dgCAPdetail.Visible = True "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
Datagrid Datasource as only specific columns in a dataset table... possible?I have a query that returns about 8 columns (there are 4 stores and 2 columns of data per store). I have a dropdown list that lets the user select the store. I want to bind a datagrid to the dataset table that is created from this query, BUT i want to only display the 2 columns that are specific to the store that was selected. Is it possible to set the datasource of a datagrid to specific only specific columns in a dataset table? If so, can you please tell me how? Thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
Best method for pulling and displaying multiple count queries as an aspx page??I have about 6-10 different moderately complex queries that are returning a count. I am wanting to figure out the best, most efficient method for running those queries and displaying the counts either in a table or a datagrid type view. Currently, I have a function that gets all the SQL Commands that I need and places them in and array. I setup a data adapter and fill a separate table on a dataset for each Count query I have. TO display I set a table's specific cells to show the dataset.tables("whatever").row(0).Item(0) It seems to take quite a long time for this method.... Does someone know something better?? I am still a beginner so any advice would be helpful. Thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
manually set backcolor of header in datagrid..helpI am using the "creat auto..." feature.... So I have to predefine the entire datagrid before hand in order to manually manipulate its properties? I was under the impression that after the datagrid was binded to the dataset and created that I could manipulate it from there. Thanks Cav "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
manually set backcolor of header in datagrid..helpI have manually created a dataset, populated a datagrid with that dataset, and I want to change the background color of certain headerstyles for certain columns. I am trying to do it this way: datagrid.columns(0).HeaderStyle.BackColor = Color.Green I always get this error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Does anyone know what process I need to go about in order to be able to do this? THanks Cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
DOS bat file help needed URGENTCurrently it is one of many files b/c it is created daily. Once the process is set in place, though, we would make it rename the file and move it and the original copy to another folder so that the active working directory would only have that one TMP file. Got any ideas? THanks "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
DOS bat file help needed URGENTI have a file that is created (0526000004.TMP) in one directory. The file is creating daily and has the format of today's date being in the name (ie. file above is the file for May 26, 2004). I need to go to that directory and grab that file (based on today's date, but formatted like the filename is formatted "MMDDxxxxYY".TMP), copy or move that file to another directory called "Backup", then copy that file to another directory called "Renamed" and rename the file "Import.TMP". From the "Renamed" directory, I will be importing that file daily into an MS Access Db. This will be a daily occurrence. Im rough with DOS commands, so any help would be much appreciated! Thanks Cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
custom validator problemSo if I keep the control to Validate NOT set and the Causes Validation set to true, I will then be able to have a conditional statement saying: If X is chosen from the dropdown Then there HAS to be something in the textbox Else it is OK to have nothing in textbox ? Thanks Cav "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
custom validator problemIt appears it will run if I have text actually in the textbox, but when the textbox is blank it will not... Will Custom Validators not work with empty textboxes? Thanks cav "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
custom validator problemYeah.. im using breakpoints... doesnt ever even hit it... EnableClientScript to false doesnt do anything either... the location of the function shouldnt matter, right? (ie. above/below the submit_btnOnClick event, right)? "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson