Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
odeh83
Starting Member
8 Posts |
Posted - 2006-04-25 : 02:06:23
|
| guys how do i prevent duplicate names to be added from a textbox into a database? this is my code but it is not working, i'm using SQL & VB.NET: Dim d As Integer Dim dupl As Integer dupl = "select count (*) from RPTPARAM" For d = 0 To dupl - 1 If TextBox.Text = "RPTNAME" Then MsgBox("Cannot Have Duplicate Values", MsgBoxStyle.Critical) End If Next |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-04-25 : 02:18:37
|
| the query should be somthing like this.. Select Count(1) From RPTPARAM where [Name] = '"&TextBox.Text&"'"If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-25 : 02:22:27
|
| Also you need to make data reader or data adapter to get the value returned from DatabaseMadhivananFailing to plan is Planning to fail |
 |
|
|
odeh83
Starting Member
8 Posts |
Posted - 2006-04-25 : 02:33:58
|
| thanx guys, but how do i use the data reader or data adapter to make it work? I'm a bit new to this stuff, plz could u help me further on this?? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-25 : 02:38:34
|
| This is SQL Server forum. Do a google search and you can find more articlesMadhivananFailing to plan is Planning to fail |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
|
|
odeh83
Starting Member
8 Posts |
Posted - 2006-04-25 : 02:45:49
|
| ok guys, thanx 4 ur help, appreciate it :) |
 |
|
|
|
|
|