Click here to Skip to main content
15,905,028 members

Bugs and Suggestions

   

General discussions, site bug reports and suggestions about the site.

For general questions check out the CodeProject FAQs. To report spam and abuse Head to the Spam and abuse watch. If you wish to report a bug privately, especially those related to security, please email webmaster@codeproject.com

 
Questioniam unable to connect sqlserver Pin
c srikanth 20214-Jul-21 3:17
c srikanth 20214-Jul-21 3:17 
using (SqlConnection conn = new SqlConnection())
            {
                //prepare conectio string
                conn.ConnectionString = "server='servername';database=D_MART;IntegratedSecurity=True";

                try
                {
                    // Prepare SQL command that we want to query

                     SqlCommand cmd = new SqlCommand();
                    cmd.CommandType = CommandType.Text;
                    // cmd.CommandText = "SELECT * FROM MYTABLE"
                    cmd.CommandText = "SELECT PRODUCT_ID FROM PRODUCT_DETAILS";
                    cmd.Connection = conn;
                    // open database connection.
                    conn.Open();

                    Console.WriteLine("Connection open!");
                    //Execute the query 
                    SqlDataReader sdr = cmd.ExecuteReader();
                    //Retrieve data from table and Display result
                    while(sdr.Read())
                    {
                        int PRODUCT_ID = (int)sdr["id"];
                        Console.WriteLine(PRODUCT_ID);

                    }
                    //Close Connection
                    conn.Close();                    
                }
                catch(Exception ex)
                {
                    Console.WriteLine("can not open connection!");
                }
            }
        }

AnswerRe: iam unable to connect sqlserver Pin
Greg Utas4-Jul-21 3:22
professionalGreg Utas4-Jul-21 3:22 
SuggestionPast reputation Pin
Nelek3-Jul-21 0:16
protectorNelek3-Jul-21 0:16 
GeneralRe: Past reputation Pin
Wendelius3-Jul-21 3:27
mentorWendelius3-Jul-21 3:27 
GeneralRe: Past reputation Pin
Richard MacCutchan3-Jul-21 5:06
mveRichard MacCutchan3-Jul-21 5:06 
GeneralRe: Past reputation Pin
Greg Utas3-Jul-21 5:37
professionalGreg Utas3-Jul-21 5:37 
GeneralRe: Past reputation Pin
Richard MacCutchan3-Jul-21 5:50
mveRichard MacCutchan3-Jul-21 5:50 
GeneralRe: Past reputation Pin
Wendelius3-Jul-21 6:51
mentorWendelius3-Jul-21 6:51 
GeneralRe: Past reputation Pin
Nelek3-Jul-21 7:36
protectorNelek3-Jul-21 7:36 
GeneralRe: Past reputation Pin
Nelek3-Jul-21 7:32
protectorNelek3-Jul-21 7:32 
GeneralRe: Past reputation Pin
Nelek3-Jul-21 7:30
protectorNelek3-Jul-21 7:30 
GeneralRe: Past reputation Pin
Richard MacCutchan3-Jul-21 8:24
mveRichard MacCutchan3-Jul-21 8:24 
GeneralRe: Past reputation Pin
Nelek3-Jul-21 8:50
protectorNelek3-Jul-21 8:50 
GeneralRe: Past reputation Pin
RedDk3-Jul-21 8:22
RedDk3-Jul-21 8:22 
GeneralWhat is happening? Pin
CodeErgoSum28-Jun-21 12:09
CodeErgoSum28-Jun-21 12:09 
GeneralRe: What is happening? Pin
Richard MacCutchan28-Jun-21 21:23
mveRichard MacCutchan28-Jun-21 21:23 
GeneralRe: What is happening? Pin
CodeErgoSum28-Jun-21 22:01
CodeErgoSum28-Jun-21 22:01 
GeneralRe: What is happening? Pin
Richard Deeming28-Jun-21 22:12
mveRichard Deeming28-Jun-21 22:12 
GeneralRe: What is happening? Pin
Richard MacCutchan28-Jun-21 22:28
mveRichard MacCutchan28-Jun-21 22:28 
GeneralRe: What is happening? Pin
CodeErgoSum29-Jun-21 5:47
CodeErgoSum29-Jun-21 5:47 
GeneralRe: What is happening? Pin
Richard MacCutchan29-Jun-21 6:54
mveRichard MacCutchan29-Jun-21 6:54 
Suggestion"Ref counts" on the home page Pin
Peter_in_278022-Jun-21 14:41
professionalPeter_in_278022-Jun-21 14:41 
GeneralRe: "Ref counts" on the home page Pin
Matthew Dennis23-Jun-21 10:11
sysadminMatthew Dennis23-Jun-21 10:11 
GeneralRe: "Ref counts" on the home page Pin
Matthew Dennis23-Jun-21 10:34
sysadminMatthew Dennis23-Jun-21 10:34 
QuestionHow do I add new tags? Pin
honey the codewitch18-Jun-21 18:57
mvahoney the codewitch18-Jun-21 18:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Flags: RejectedAnsweredFixedSolved

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.