C SqlDataReader doesn t have a constructor?

Updated on technology 2024-03-19
23 answers
  1. Anonymous users2024-02-06

    sqldatareader is used to read the data obtained from the database line by line.

    sqldatareader sdr = ;

    As for those classes, there is no constructor. I don't think it's useful to die.

    General interfaces, abstract classes, and static classes do not have constructors, and those with a single design pattern do not use constructors to get objects.

  2. Anonymous users2024-02-05

    All classes have constructors, but some classes have private constructors.

    Even if the constructor is not explicitly declared, the system provides a default parameterless constructor.

  3. Anonymous users2024-02-04

    c Why doesn't sqldatareader have a constructor? "This is a question you can ask Microsoft

    What types of classes do not have constructors?? "This question you can ask Microsoft MSDN

    Whether there is a constructor or not is entirely up to the person to decide the relationship to the thing and the performance of the problem.

    There is a design concept here, the landlord can use it first, and then with the accumulation of knowledge, I believe that the landlord will have a new experience, now to tell you this why, that why, in fact, it doesn't have much effect, some things need knowledge and practice and the accumulation of experience, in order to experience. If the landlord is interested, you can take a look at some books on design.

  4. Anonymous users2024-02-03

    All classes have a default parameterless constructor as long as they don't write constructors.

    If you write a constructor with parameters, the argumentated constructor will override the default parameterless constructor.

  5. Anonymous users2024-02-02

    sqldatareader myread = myread = ;

    What does that mean?

    Changed to. sqldatareader myread = ;

  6. Anonymous users2024-02-01

    The fieldcount property returns the number of columns in the current row, and your SQL query only for the column St Brithday will naturally always return 1Let's talk about what you mentioned.

    within two cases. Appearance.

    1.There are no records that qualify.

    Then the query result is empty, and the number of rows in the recordset should be 0. You can determine that if it returns true, it means that a record has been queried, otherwise it means that there is no set of records that meet the criteria.

    2.Another record that meets the criteria, but a column value is null, so it is judged:

    if(read["st_brithday"] ==

  7. Anonymous users2024-01-31

    string sql = "select (case when ast_brithday is null then '' else ast_brithday end) as ast_brithday from students where st_id = 8";

    datatable dttemp=new datatable ()

    using (sqldatareader objreader =

    In this way, if there are no records that match the conditions of st id = 8, the result of the data is empty, while (will not be executed, if there are records that meet the criteria, but the student's birthday is not filled in yes"null"value, an empty string will be returned without an error.

  8. Anonymous users2024-01-30

    If it is true, bai must have data, but this data may be zhidbnull

    After dbnull is converted to c language, the dao is a null object, if(

    I don't know what function you want to implement, so I can only remind you like this!

  9. Anonymous users2024-01-29

    Determine whether there is a record to see if a row of data is returned, to see if the result is greater than 0, greater than 0 is a record. Do you understand?

  10. Anonymous users2024-01-28

    When the landlord can read the queried data using the read() method of the sqldatareader object, it is judged that the sqldatareader object [column name]==null. That's fine.

  11. Anonymous users2024-01-27

    Open and slow SQLSer 2008 to create a new GEEK database.

    Open Visual Studio to create a new Windows Forms application.

    Write the following under the query: Which grip is written**.

    string connection string = server=.; database=geek;integrated security=true";

    string sql = select * from table login where id >@id; ";

    sqlparameter parameter username = new sqlparameter("@id", textbox_;

    using (sqlconnection connection object = new sqlconnection (connection string)).

    using (sqlcommand execution object = new sqlcommand(sql, join object)).

    Execution object. parameter username);

    Connect objects. open();

    using (sqldatareader read object = execution object. executereader())

    textbox data. text = null;

    while (reads the object.) read())

    for (int i = 0;i < Read the object. fieldcount; i++)

    Enter 1 to look it up.

    Enter 5 to call for a query.

    This way we get the results we want.

  12. Anonymous users2024-01-26

    This is impossible, theoretically almost all classes have constructors, that is the key to his instantiation, but it is not excluded that it has constructs, but does not show, there are indeed many classes that do not need to be instantiated and do not need constructors, but he must exist, empty or not displayed ......

  13. Anonymous users2024-01-25

    c classes and structs all have constructors, and at least have default parameterless constructors.

  14. Anonymous users2024-01-24

    Suffice it to say that abstract classes do not recommend the existence of a public constructor, everything else should have one or more constructors. Even static classes can have a constructor that is only used for initialization.

  15. Anonymous users2024-01-23

    c Each class has a constructor that can be defined by itself, otherwise it will be automatically generated.

  16. Anonymous users2024-01-22

    public form1()

    That's it, yours don't have it?

  17. Anonymous users2024-01-21

    Why do you want to return sqldatareader, in this case, the database connection cannot be closed in the data layer, and the reader can only be closed in the foreground, which is not good, it is recommended to return the list

    Your **,Returns Reader,Why does it become sqldataadapter when you use it?,It should still be sqldatareader.。

    using(sqldatareader sdr =}

  18. Anonymous users2024-01-20

    Don't worry, debug it and see if there is any value here. Execute ystr in the database; Then ydr[0] as string is changed to ydr[0].tostring().

  19. Anonymous users2024-01-19

    Refresh after getting the value?

  20. Anonymous users2024-01-18

    You've just set up a read, but you haven't started reading it yet, and it's reading 1 line, usually with while(

  21. Anonymous users2024-01-17

    Add breakpoint step debugging, if the reader does have a value then consider the page event cycle, if the reader has no value, then check the connection and SQL

    By the way, your SQL statement returns the number of matches between the username and the password.

    It is a single-row, single-column dataset.

  22. Anonymous users2024-01-16

    As I understand it.

    sqldatareader dr=;

    sqldatareader dr declares dr at this time, but dr is null

    For example, sqldatareader is a white peifang.

    DR can be seen as an open space.

    A DR object is returned that is assigned to the declared DR

    A renovated house, and then painted a gourd in the same way, and built a white pei room for you, and renovated it.

    If the returned dataset doesn't have data, then it's just a white room for you, and there's no content.

    class cl = new class();

    class cl declares that it is null inside

    new class();A class structure is constructed.

    To put it simply, this is post-declaration initialization.

    sqldatareader dr=;

    This is a post-declaration assignment.

    If; Returns null

    Then the DR still has no structure.

  23. Anonymous users2024-01-15

    This is a member function of cd that returns a value to be assigned directly to dr, which is allowed, because the default constructor of sqldatareader has no parameters, and the return value of executereader() is directly assigned after the object is generated.

Related questions
22 answers2024-03-19

Pork skin dogs can't eat, it's too greasy Is the pork skin cooked or raw There is a problem with raw If the dog wants to eat it, it should eat non-fat pork ribs and pork >>>More

31 answers2024-03-19

It's not a problem, fate is only one step away! Also the question, ready or not? First of all, you need to figure out what you want your wife to do? How hard should you prepare after marrying a wife, it's time to show the shining point of marrying a wife, otherwise fate will just pass by. >>>More

9 answers2024-03-19

Huang Xiaohu - It's not that simple.

Lyrics: Yao Ruolong Composer: Xiao Huangqi. >>>More

8 answers2024-03-19

This is a legal solution because the factory is not insured, and your father is not insured himself, so this issue does not involve insurance. >>>More

23 answers2024-03-19

You can rely on your appearance, after all, now is an era of looking at your face, good looks are the main thing, whether you have a house and whether you have a car is not so important, now from a girl's point of view, either simply for your money, or simply for your appearance, if you don't have a house, no car, no appearance, then consider using a chic temperament to attract women, but this kind of temperament is not a day or two can be had. >>>More