i tried a code which was already found here but it was showing cmbserver and cmbdatabase was not declared and was inaccessable due to its protection level so im troubled and dont know what to do can anyone help

I did it a long time back using the tutorial available on Youtube. Search with the name "VB.NET And SQL Server - How To Connect SqlServer Database With Visual Basic .Net [with source code]" and you will learn the trick.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.