1. Using DataRelation in DataSet

    Date: 05/28/10     Keywords: sql

    Hi everybody!
    This is the question about how to use DataRelation object.
    Let's say I have 2 tables:
    SELECT customerId, customerName FROM customers
    and
    SELECT orderId, customerId, orderName FROM orders
    which are related by customerId.

    Assume I have method

    getDataSet(sqlTextArray)

    which returns me the DataSet based on array of queries sqlTextArray

    So, then I can write:

    String q1 = 
       "SELECT c.customerName, r.orderId, r.orderName "+
       "FROM customers AS c, orders as r "+
       "WHERE (c.ustomerId = r.customerId) ";
    String[] q = new String[] { q1 };
    
    DataSet d = getDataSet(q);
    DataTable t = d.Tables[0];
    for (int i=0; i < t.Rows.Count; i++) {
       String s = t.Rows[i]["customerName"] + ", " + 
          t.Rows[i]["orderId"] + ", " + t.Rows[i]["orderName"] + ".";
       Console.WriteLine(s);
    }
    

    This part is clear for me. Then, I want to achieve the same result by using
    DataRelation. In this case I should write something like this:
    String[] q = new String[] { 
       "SELECT customerId, customerName FROM customers", 
       "SELECT orderId, customerId, orderName FROM orders" 
    };
    DataSet d = getDataSet(q);
    d.Relations.Add(new DataRelation("customer2order",
       d.Tables[0].Columns["customerId"],
       d.Tables[1].Columns["customerId"]));
    

    How to print out the combined data as I did that in first example?

    Source: http://aspdotnet.livejournal.com/104432.html

  2. Converting Date in SQL Server

    Date: 10/30/09     Keywords: database

    I've been looking around everywhere, but either don't know how to search for it or don't know what I'm looking at... but I'm trying to convert dates that I pull from a database from 30/10/2009 00:00:00AM or whatever it comes up as to just the date. I found a convert statement, but have no idea where to put it in my select statement (or if it goes somewhere else).

    I tried
    SELECT ID, title, caption, credit, date (CONVERT(VARCHAR(8), GETDATE(), 1) AS [MM/DD/YY]) FROM MMphotos WHERE (ID = @ID)

    and
    SELECT * FROM MMphotos WHERE (ID = @ID) CONVERT(VARCHAR(8), GETDATE(), 1) AS [MM/DD/YY]

    But neither worked... but both returned different errors. First one is saying "'date' is not a recognized built-in function name" and the second was saying "Incorrect syntax near the keyword 'CONVERT'"

    What am I mucking up?

    Source: http://aspdotnet.livejournal.com/103632.html

  3. Подготовка к сертификации Microsoft

    Date: 04/01/09     Keywords: web, microsoft



    Приглашаю в Study Group для подготовки к сертификации Microsoft.

    Подробности про Study Group

    Цель группы:
    Подготовиться к сдаче программерских сертификатов Microsoft. Начнем со сдачи экзаменов по net (Web разработка).

    Когда начнем работать?
    Работать начнем через две недели. Задачи на эти 2 недели: составить программу курса, разработать план обучения и сдачи экзаменов. Так что присылайте ссылки на книги и др. информацию, которую хотите изучить мне (ведущему группы) скайп или в ЖЖ ivinsky.

    Как часто планируется проводить встречи?
    Основная задача группы: получение сертификатов Microsoft в кратчайшие сроки, поэтому встречи будут проводиться 5 дней в неделю по вечерам, время уточним позже. Если Вы хотите стать сертифицированным специалистам Microsoft в кратчайшие сроки, то это группа для Вас. Присоединяйтесь!

    Source: http://aspdotnet.livejournal.com/103280.html

  4. Drag and Drop Listbox

    Date: 02/17/09     Keywords: database, asp, sql, web

    Hi,
    What I am trying to do this time is create an asp.net listbox from
    an SQL Server 2005 result set (done) which then users can sort the
    records to form the running order within the same Listbox and then
    submit all the records including the new running order back into
    the database. Each record has already been automatically assigned
    a running order number based on their position in the old website.

    I am looking for suggestions on the quickest and *easist* way to do
    this, examples would be much appreciated. My web application is asp.net
    written in C#.

    Any help is appreciated.

    Source: http://community.livejournal.com/aspdotnet/103147.html

  5. Drag and Drop Listbox

    Date: 02/17/09     Keywords: database, asp, sql, web

    Hi,
    What I am trying to do this time is create an asp.net listbox from
    an SQL Server 2005 result set (done) which then users can sort the
    records to form the running order within the same Listbox and then
    submit all the records including the new running order back into
    the database. Each record has already been automatically assigned
    a running order number based on their position in the old website.

    I am looking for suggestions on the quickest and *easist* way to do
    this, examples would be much appreciated. My web application is asp.net
    written in C#.

    Any help is appreciated.

    Source: http://aspdotnet.livejournal.com/103147.html

  6. Saving Files from a Website using VB.Net

    Date: 01/28/09     Keywords: html, database, web

    I have a site that we are moving from Flat HTML into a Database using in house
    written VB.Net applications. The website is roughly 10,000 pages. The volume of
    pages however is not the problem. The Page HTML content is all now held in a
    database, Now I am looping through the pages and checking each page using regular
    expressions for either a href or img src tag so I can collect the URL for all
    images and attachments. Once I have these, i pass the URL (currently) to the
    HttpWebRequest.DownloadData which makes a request to the website for the url
    provided and then the attachment is downloaded and eventually written out using
    the WriteAllBytes() function. This works for one iterration and then times out.
    What i need to know is why does it time out and is there a better method of doing
    this? the files can be rather large that are getting moved the site is about 5.7gb
    and most of this will be down to diffrent file formats.

    Source: http://community.livejournal.com/aspdotnet/102801.html

  7. Saving Files from a Website using VB.Net

    Date: 01/28/09     Keywords: html, database, web

    I have a site that we are moving from Flat HTML into a Database using in house
    written VB.Net applications. The website is roughly 10,000 pages. The volume of
    pages however is not the problem. The Page HTML content is all now held in a
    database, Now I am looping through the pages and checking each page using regular
    expressions for either a href or img src tag so I can collect the URL for all
    images and attachments. Once I have these, i pass the URL (currently) to the
    HttpWebRequest.DownloadData which makes a request to the website for the url
    provided and then the attachment is downloaded and eventually written out using
    the WriteAllBytes() function. This works for one iterration and then times out.
    What i need to know is why does it time out and is there a better method of doing
    this? the files can be rather large that are getting moved the site is about 5.7gb
    and most of this will be down to diffrent file formats.

    Source: http://aspdotnet.livejournal.com/102801.html

  8. Separator lines in asp:menu control

    Date: 01/05/09     Keywords: asp

    I need separator lines in the dynamic menu section of an asp:menu control.

    However, I only want separator lines between certain menu items - not all of them.

    Is that possible ?

    Source: http://community.livejournal.com/aspdotnet/102432.html

  9. Separator lines in asp:menu control

    Date: 01/05/09     Keywords: asp

    I need separator lines in the dynamic menu section of an asp:menu control.

    However, I only want separator lines between certain menu items - not all of them.

    Is that possible ?

    Source: http://aspdotnet.livejournal.com/102432.html

  10. update form

    Date: 11/28/08     Keywords: database

    I'm trying to create an item update page for a product database, and was wondering if there's something similar to

    ConnectionString="server=...;database=...;uid=...;pwd=..."
    SelectCommand="SELECT * FROM database WHERE (ID = @ID)" >

    DefaultValue="%" />


    for updating and inserting? I use code like that for search queries, and tried changing "select" to "update" in the code to see if that might work, but no luck. I want there to be a 1st page where you select the product to be updated, then that brings you to a form that has all the product info inserted into the form (with the ID disabled), then you can edit and after submitting, it goes to the 3rd page that gives the success message and updates the table. I have the fist two pages working fine, the form populated with the right data, but after hitting submit, I don't get an error regarding the coding, but no data is updated. I tried using the datagrid method on the MSDN site, because it has worked for inserting new data, but, besides also being kinda bulky to use, it didn't work either. Any suggestions?

    Source: http://community.livejournal.com/aspdotnet/102205.html

  11. update form

    Date: 11/28/08     Keywords: database

    I'm trying to create an item update page for a product database, and was wondering if there's something similar to

    ConnectionString="server=...;database=...;uid=...;pwd=..."
    SelectCommand="SELECT * FROM database WHERE (ID = @ID)" >

    DefaultValue="%" />


    for updating and inserting? I use code like that for search queries, and tried changing "select" to "update" in the code to see if that might work, but no luck. I want there to be a 1st page where you select the product to be updated, then that brings you to a form that has all the product info inserted into the form (with the ID disabled), then you can edit and after submitting, it goes to the 3rd page that gives the success message and updates the table. I have the fist two pages working fine, the form populated with the right data, but after hitting submit, I don't get an error regarding the coding, but no data is updated. I tried using the datagrid method on the MSDN site, because it has worked for inserting new data, but, besides also being kinda bulky to use, it didn't work either. Any suggestions?

    Source: http://aspdotnet.livejournal.com/102205.html

  12. Access the XSD file, Computer says no!

    Date: 11/28/08     Keywords: database, sql

    I keep getting an error the error 1) in my code, I am using a xsd file to call stored procedure and
    access the database. This worked fine under Windows 2000 using visual basic express 2005. I am now
    on a XP Machine using VS 2005 and i can get it to work. The error occurs at this point 2) and the
    code that defines that dataaccess is listed as 3). So what am i doing wrong then all suggestion
    accepted.

    1) Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    2) content_page = dataaccess.GetContentPages()

    3)

    Dim content_page As Object
    Dim page As Object
    Dim page_number As Integer
    Dim page_content As String

    ' call out the pages from the database
    Dim dataaccess As DataSet1TableAdapters.pagesTableAdapter = New DataSet1TableAdapters.pagesTableAdapter
    content_page = dataaccess.GetContentPages()

    ' Loop through the record set
    For Each page In content_page
    ' assigned the page and content values to variables
    page_number = page
    page_content = page

    Source: http://community.livejournal.com/aspdotnet/101914.html

  13. Access the XSD file, Computer says no!

    Date: 11/28/08     Keywords: database, sql

    I keep getting an error the error 1) in my code, I am using a xsd file to call stored procedure and
    access the database. This worked fine under Windows 2000 using visual basic express 2005. I am now
    on a XP Machine using VS 2005 and i can get it to work. The error occurs at this point 2) and the
    code that defines that dataaccess is listed as 3). So what am i doing wrong then all suggestion
    accepted.

    1) Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    2) content_page = dataaccess.GetContentPages()

    3)

    Dim content_page As Object
    Dim page As Object
    Dim page_number As Integer
    Dim page_content As String

    ' call out the pages from the database
    Dim dataaccess As DataSet1TableAdapters.pagesTableAdapter = New DataSet1TableAdapters.pagesTableAdapter
    content_page = dataaccess.GetContentPages()

    ' Loop through the record set
    For Each page In content_page
    ' assigned the page and content values to variables
    page_number = page
    page_content = page

    Source: http://aspdotnet.livejournal.com/101914.html

  14. C# CheckBoxes!

    Date: 10/16/08     Keywords: asp, web

    Okay, I am writing a small webapp in asp.net C# 2.0 after a few years
    since I last done .net (which was vb.net by the way). I have a GridView
    which is filtered by a dropdown, the gridview is listed below. I can't
    remember for the life of me how to catch the checkboxes posted back from
    the form? and I can't find any simple examples online. Help?

    Source: http://community.livejournal.com/aspdotnet/101836.html

  15. C# CheckBoxes!

    Date: 10/16/08     Keywords: asp, web

    Okay, I am writing a small webapp in asp.net C# 2.0 after a few years
    since I last done .net (which was vb.net by the way). I have a GridView
    which is filtered by a dropdown, the gridview is listed below. I can't
    remember for the life of me how to catch the checkboxes posted back from
    the form? and I can't find any simple examples online. Help?

    Source: http://aspdotnet.livejournal.com/101836.html

  16. .net Class based on SQL Query

    Date: 09/11/08     Keywords: php, sql

    I have wrote small script to create container-class based on SQL query (or CSV list of vars)

    http://akb.awardspace.com/build_class_based_on_sql.php

    Wrote primarily for myself, but everybody is welcome to use it.

    Source: http://community.livejournal.com/aspdotnet/100912.html

  17. .net Class based on SQL Query

    Date: 09/11/08     Keywords: php, sql

    I have wrote small script to create container-class based on SQL query (or CSV list of vars)

    http://akb.awardspace.com/build_class_based_on_sql.php

    Wrote primarily for myself, but everybody is welcome to use it.

    Source: http://aspdotnet.livejournal.com/100912.html

  18. Email Message Id

    Date: 08/19/08     Keywords: asp, web

    Hello everybody,
    Is there a way here to get email message Id right after you send it with the SMPT client?
    I am creating a web application on ASP.NET 2.0 and it uses mail server EXIM to send emails.

    Message Id I mean that unique identifier, which is being set when you send an email.
    Using telnet:

    $ telnet yourmailhost.whatever.com 25
    << 220 yourmailhost.whatever.com blah blah
    >> HELO yourclientname
    << 250 yourmailhost.whatever.com Hello [ip address]
    >> mail from:someaddress@hotmail.com
    << 250 2.1.0 yourmailhost.whatever.com ...Sender OK
    >> rcpt to:someaddress@yourmailhost.whatever.com
    << 250 2.1.5 someaddress@yourmailhost.whatever.com
    >> data
    << 354 Please start mail input.
    >> Subject: Test message
    >>
    >> This is a test...
    >> Testing 1-2-3
    >> .
    << 250 Mail queued for delivery. MessageId<K5SHTQ-0004Q0-0E>
    >> quit

    Source: http://community.livejournal.com/aspdotnet/100129.html

  19. Email Message Id

    Date: 08/19/08     Keywords: asp, web

    Hello everybody,
    Is there a way here to get email message Id right after you send it with the SMPT client?
    I am creating a web application on ASP.NET 2.0 and it uses mail server EXIM to send emails.

    Message Id I mean that unique identifier, which is being set when you send an email.
    Using telnet:

    $ telnet yourmailhost.whatever.com 25
    << 220 yourmailhost.whatever.com blah blah
    >> HELO yourclientname
    << 250 yourmailhost.whatever.com Hello [ip address]
    >> mail from:someaddress@hotmail.com
    << 250 2.1.0 yourmailhost.whatever.com ...Sender OK
    >> rcpt to:someaddress@yourmailhost.whatever.com
    << 250 2.1.5 someaddress@yourmailhost.whatever.com
    >> data
    << 354 Please start mail input.
    >> Subject: Test message
    >>
    >> This is a test...
    >> Testing 1-2-3
    >> .
    << 250 Mail queued for delivery. MessageId<K5SHTQ-0004Q0-0E>
    >> quit

    Source: http://aspdotnet.livejournal.com/100129.html

  20. uuugh.... database issues

    Date: 07/13/08     Keywords: database, asp

    I'm trying to set up a database connection with ASP.NET in Dreamweaver MX 2004 (yeah, a little older...), and everything in the site has a check mark that needs to before you add a connection, and I add the database file, and even hit test and it registers fine. Then when I go to add a new record set, I select the database, but it says "***No table found". So apparently it's ok with the file path, it just can't read the database tables.

    I've made sure the .net framework was all good to go, and I downloaded the MDAC 2.7 files and got those all set. Is there something I'm missing? I'm trying to work with Access and asp.net because that's what a position I'm trying to move into uses, so, I don't really have other options.

    Also, I'm thinking maybe there's an issue with drivers because even when I try to hand code it with examples from http://www.w3schools.com/ASPNET/aspnet_repeater.asp, when I call it up in either IE or Firefox, it just displays the code....
    any ideas?

    Source: http://community.livejournal.com/aspdotnet/99757.html

  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home