I have a table "tbl_order" with to the fields "customer_number" and "date". there can be multiple rows with the same customer_number, but the date fields are allways unique. these or potential rows in my table: cust_no | date | item --------------------------- 21 2006-01-06 shovel 21 2006-03-05 axe 21 2006-05-05 widget 45 2006-05-01 fish tank 45 2006-05-02 ... For every cust_no i want to retreive only the row with the earliest date. How can this be done? what i want is this: ------------------------ 21 2006-01-06 shovel 45 2006-05-01 fish tank Any help would be greatly appreciated / Stefan
Stefan R
Posts
-
Selecting rows by earliest date -
Biztalk - Certificates and PartiesHi there. I read on MSDN that one can use a certificate associated with a party to encrypt messages to that party. But in the Certificate tab in the Party Properties dialog it says "Signature certificate" (indicating that the specified certificate will be used to sign messages, not to encrypt them). It would have been nice if this certificate overrides the one specified on the port. Am I missing something here? *Is there a way to dynamically set an encryption certificate on a Send Port (not by programming to Biztalk Explorer OM) through an orchestration by passing parameters to a shape of some sort? *Or do i have to create a new port for each Party, and on that port specify the encryption certificate for that specific Party? The results should be like a dynamic send port that has a dynamic "address" AND replaceble/dynamic certificates. Is this possible?
-
Delete command with DataSet and DataAdapterI tried changing primary key data type from "PM" to "Text" in the db and now it works just fine. I really did have a primary key though :^), and after reading that thing about "...OleDbDataAdapter not fetching primary key constraints..." on MSDN i really thought i was in trouble. But as always, the problem lies in something small and unsignificant to the eye
Dave Kreskowiak wrote:
[EDIT]Sorry, wrong language for the forum...[/EDIT]
I'm pretty fluent in VB syntax so i don't mind :) Thanks a lot for the help!
-
Delete command with DataSet and DataAdapterI know i can easily delete all records with "delete from biler" and i know the problem is not related to my SQL-statements or db schema. I'm just new to working with the DataSet. Since i want to learn how to work with the dataset i want to avoid using the method above. I want to be able to remove records one by one in the future... The table has a primary key defined in my Access db, however it seems that the DataAdapter doesn't retrieve any meta data about primary keys and constraints from the table( as stated in msdn ). That's probably way the message says that i don't have a primary key. MSDN also states that i should specify which column is the key column somewhere in code and i have read something about
MissingSchemaAction.AddWithKey
... The problem is that i can't seem to get it right. How do i make the DataAdapter fetch information about the primary key? Or how do i tell the DataAdapter that a certain column in the fetched table is actually a primary key column? This is really bugging me out -- modified at 4:59 Friday 23rd December, 2005 -
Delete command with DataSet and DataAdapterGood evening ( although it's night time in Sweden) I'm trying to delete all my records in a single table with a DataAdapter. The code I use is this:
odbAdapter = new OleDbDataAdapter(); odbAdapter.SelectCommand = new OleDbCommand("Select * from Bilder", odbConnection); OleDbCommandBuilder cb = new OleDbCommandBuilder(odbAdapter); odbConnection.Open(); odbAdapter.Fill(ds, "Bilder"); DataTable dt = ds.Tables["Bilder"]; DataRow[] dr = dt.Select(); foreach(DataRow item in dr) { item.Delete(); } odbAdapter.DeleteCommand = cb.GetDeleteCommand(); odbAdapter.Update(ds,"Bilder");
However, I get an error message saying :Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information
I'm guessing this has something to do with a primary key or something, judging by info gathered at other places. The primary key in the table is not automatically generated or anything. What the heck am i doing wrong here? -
Images don't show up on remote computersThe root relative path being the path from the absolute root (like c: ) or the webserver root? Is switching "\" to "/" going to help? -- modified at 11:04 Friday 9th December, 2005
-
Images don't show up on remote computersI'll go with the subfolder thing, easy enough:) Thanks a lot for the help! *back to coding
-
Images don't show up on remote computersThese are the paths i'm working with: the webpage -> C:\Inetpub\wwwroot\WebApplication1 the image -> C:\Inetpub\wwwroot\images\ I used the Visual Studio to create the a relatve path to "C:\Inetpub\wwwroot\images\img.jpg" and it didn't work, this did however: "..\images\img.jpg". I would like to display images that are in for example "c:\documents\images\" but have no idea how to make a relative path from my webserver dir to that dir. Is this possible? Or do images be have to be stored in the web-servers subdirectories in order to work? Thanks a lot for taking time to help me! -- modified at 10:43 Friday 9th December, 2005
-
Images don't show up on remote computersStill not doing it.. Thanks anyway
-
Images don't show up on remote computersHello, again. When I surf to my webpage hosted on my own computer, images work as expected. However when my friends surf from their computer to my page they get a broken image link. I figured this was an asp web-control issue but buttons/textboxes etc show up properly. I have tried moving my images to wwwroot/images/ but to no avail. Images are still missing on remote computers. What's up with this? you can check it out for yourselves at http://gnocchi.mine.nu/WebApplication1/WebForm1.aspx[^] Don't mind the desing (if it's visible ;P) the page is *very* experimental.
-
Resizing things with DataBinder.EvalThanks a lot guys! You really helped me. I had my suspicions about that Unit thing but I didn't think I could perform type-casting in the html-page. Just one more question: The code between the
"<%#...%>"
is taken care of by the server. Does this mean that I can use C# code here in the same way as in the code-behind? About that java-thing, let's just say that Mr Gates and his cronies know how to make things easier (I'm a veteran, diet-version, at Java). No way I'm going back now. But you'll probably hear from me again - I'm learning by trial and error and a great deal asking/searching/doing;P -- modified at 8:59 Friday 9th December, 2005 -
Resizing things with DataBinder.Evali'm using an access db so the value is set to text. I believe it's the same as varchar and the others. The control i want to manipulate is an asp:linkbutton, see below: asp:ImageButton ImageUrl='<%# DataBinder.Eval(Container.DataItem, "path") %>' width='<%# DataBinder.Eval(Container.DataItem, "thumb_width") %>' Runat=server -- modified at 19:02 Thursday 8th December, 2005
-
Resizing things with DataBinder.EvalI am trying to set the size of an imagebutton dynamically through databound values. Is there any way to make this work: height='<%# DataBinder.Eval(Container.DataItem, "thumb_width") %>' The above line is from the html-page with the proper code preceding it (using Visual Studio..). I get a "Specified cast is not valid" message when i try this. Why is this happening? The databound value is "100px" and i have tried "100" as well, but nothing works. I'm really thinking about going back to Java again, I suck at asp.net;) -- modified at 18:40 Thursday 8th December, 2005
-
File access problemsHello again. Feels like I'm posting here on a 200-times a day basis.. My problem is that I get an "access denied" error message when I do this: FileStream fs = new FileStream(path,FileMode.Open, FileAccess.Read,FileShare.Read); I know I have to set persmissions for ASP.NET on the directory/file that is going to be manipulated - I granted the account full permission. Still that annoying error. I'm probably missing something as usual, but please help me. :sigh: / Stefan
-
Decimals missingHello. I want to do something like this: float number = 3 / 2; The problem is that the decimals don't show up, all that is displayed is "1" instead of 1.5. I have tried using float/double/decimal but still the decimals disappear. What's wrong? Am I missing something here?
-
Division and decimals in C#/ASP.netHello everyone. I am trying to resize an image by using the relations between its height and width but can't get it to work. Let's say the dimensions are 3*2(width*height), to use this relation in resizing i would have an expression that looks like this: image.height = 100 * (2/3); // (2/3) is eq. to height /width image.widht = 100; this should keep all ratios intact, right? The problem is that the division (width/height) only returns a "0" and not the decimal parts! What am i doing wrong? Will be grateful for all answers / Stefan
-
Listing records in both columns and rowsHi. I would like to know if someone has come up with an easy way to list records in both columns and rows. I'm at my wits end here, since I don't know how to tell a repeater/datalist to insert my records in a 2-dimensional vector / matrix. I would like to present my records in a 4x4 vector but all i can come up with is how to list the records one by one vertically. Any tips and suggestions would be much appreciated!