Hi, i am a beginner in using ASP.NET. I have this problem. Whenever i select the advanced options in configuring the sqldatasource, the Advanced SQL Generation Options are all greyed out/disabled. Now, i found out that the cause of this is because the table that i am trying to access doesnt have a primary key.

the scenario is that the table already has data.

My question is, how do i put a column in asp.net, that can serve as the primary key for the table? I want to do this only in asp.net and not through using SSMS.

Thank You!

Configure sqldatasource manually or use objectdatasource. Take a look at this article - http://www.asp.net/(S(ywiyuluxr3qb2dfva1z5lgeg))/learn/data-access/tutorial-49-cs.aspx

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.