First of all bro thank you very much for these exellent tutorials, here is one simple question if you leave txtFirstName empty and try inserting data it will give an error "Input string was not in a correct format.", what could we put so that it simply shows a messagebox diplaying that we need to enter field, click OK and continue inserting, i tried:
if (txtFirstName.Text.Trim() == "") MessageBox.Show("Missing FirstName.");
Thanks a lot for your kind help, i have some questions did MS SQL accept movies? i mean i create a website such as Youtube as an example depend on MS SQL? and how i can do that?
I would like to thank you so much for your enthusiastic and clear explanation of manipulating data using sql & c#. Like MariKotvanova I was so frustrated with not being able to fully comprehend the information on the MSDN website. The challenge seemed enormous. By you generously passing on the information has greatly improved my circumstances at college and more importantly my understanding of sqlserver and c#. Thank you so much and hope you continue this good work.
thank you so much for your videos! you can't even imagine how helpful they were for me) i passed my course project on writing database only with your help! just couple days ago i was completly frustrated, cause i had no idea how to do that, and google couldn't help
This is really interesting stuff. But who does it work with auto-incremented fields of your database as ID's and so. What value do you set in your parameter?
Can you make a video that show us how do like when we make an update to the database, the other client also aware of the update in the database application. thankssss
Couple of things: First .. "...Data Source=.\\SQLEXPRESS;..." 2 backslashes? Try ".\SQLEXPRESS" instead of ".\\SQLEXPRESS" Second: "; Integrated Security=TRUE");" means that Windows Authorization is enabled.. perhaps you need to enter the SQl user name and password... Try using this instead of "Integrated Security=TRUE": ";User Id=myUsername;Password=myPassword;" I hope this helps.. good luck.
@BablioBr What if i have a table Student and want a field that displays student picture in a pictureBox (and also be able to browse image files and change it), StudentID could be foreign key of ImageDB table (assuming we have Student and ImageDB tables separate) and somehow find a way so that when selecting a specific row from datagrid pictureBox gets updated with image linked to that StudentID
Fabio, would you help me? I'm trying to access my SQL Database but every time I try, I receive this message: "Login failed for this user". I am working on a project and I need to solve this ASAP. Here is the code:
Fabio, could you help me? I'm trying to access my SQL Database but every time I try, I receive this message: "Login failed for this user". I am working on a project and I need to solve this ASAP. Here is the code:
I came back and rated right after I saw your video "Part 5 of 5: Deleting Data from SQL using SqlDataAdapter and the DeleteCommand with C# ", which I don't usually do that I have to, cuz the quality of your tutorials are so simple to understand and so useful. keep posting your hard works, plx, thx....
You're a life saver. But don't you have a website where we can download your files, sample programs, etc? That would really be helpful. Thanks so much! :)
why when i use the code in this example, i get : "The number of columns in the query and the table must match. [ Number of columns in query = 2, Number of columns in table = 3 ]" .
Note 2: table has id, name, date ; I use insertcommand for name and date, so i guess it "wants" something for id; cand anyone help me?
Great tutorial! I have a question in connection string. What connection string I will be used if I will make my application with network database as an installer?
hi Bablio i cant connect to my sqlserver express using this.. are there no difference between server and server express regarding the connection string / syntax? thanks
this is one of the best tutorial for database connection. I am working on visusal web developer. IN my project web application which has check boxes. Can you please tell me how to define and retrieve data for checkbox ?
Thank you so much for being so helpful in this video!
@karlinoDS Without looking at you code, my best guess is that your ID column is the problem. "Column name or number of supplied values does not match table definition. "Column name" - make sure your INSERT sql has the right syntax.. correct spelling of the column names. "Number of supplied values does not match table definition" - make sure you are passing all value to all column.
@karlinoDS In regards to the ID column in SQL make sure it has this specifications: Identity Specification: Yes; (is Identity): Yes; Identity Increment :1; Identity Seed: 1; I hope this will help.
I was wondering. I'm making a simple form that inserts data into a single table with a stored procedure. Normally, this wouldn't be hard, except for one problem. One column uses a type of encryption, so to insert, I would have to first declare a password, then insert the data.
Hi Fabio. Help me please! Your tutorials online have been so helpful. I wouldn't have gotten this far this semester without your videos, but I'm running into a problem adding an existing database using Visual Studios. I'm trying to add new data to the database and then display the new information with the old data our professor has added already to the database.
Hello Fabio. I only signed up to youtube membership to tell how great your tutorials are, and how they are saving students' lives around the world. Thank you ever so much for making such a generous effort solely for the benefit of others, please keep this up, and make lots of fans (like me) round the globe everyday. God bless.
@tanvirctg Wow, that s really nice and interresting comment. First of all thank you. Secondly I trully started this series, because as I was in school I noticed a huge lack of informatoin in this specific area. I'm glad it helped you. Stay tuned, I am starting a series in delegates.. I will be posting it soon. Also check out our group on facebook, " Learn C# - The Right Way ".
Error 1 Unable to copy file "obj\Release\WiimoteWhiteboard v0.3.exe" to "bin\Release\WiimoteWhiteboard v0.3.exe". The process cannot access the file 'bin\Release\WiimoteWhiteboard v0.3.exe' because it is being used by another process. WiimoteWhiteboard
hi thank you this a very clear and help full video cant wait to see more from u the only problem is that my connection string is not working but im sure ill figure it out but thanks for the good work wish there was more people like you making tutorials u make it easy to understand .
Hi, Thanks for this helpful video but I am getting 2 errors at da.InsertCommand.Parameters.Add("@FIRSTNAME", SqlDbType.VarChar).Value =txtFirstName.Text; da.InsertCommand.Parameters.Add("@LASTNAME", SqlDbType.VarChar).Value = txtLastName.Text;
1) it is saying the txtFirstName doesn't exist in current context
Hi, Thanks for this helpful video but I am getting 2 errors at da.InsertCommand.Parameters.Add("@FIRSTNAME", SqlDbType.VarChar).Value =txtFirstName.Text; da.InsertCommand.Parameters.Add("@LASTNAME", SqlDbType.VarChar).Value = txtLastName.Text;
1) it is saying the txtFirstName doesn't exist in current context
i have success to make a database app using the way in video, but i fail to running app again when i transfer all the file to another computer. how to solve this problem so i can use it om my computer and another computer?
hey guys, if some of you have the problem with connecting to sql, just use this code, it works for sure: SqlConnection cs = new SqlConnection(@"server = .\sqlexpress; integrated security = true;database = youtube");
hey guys, i am trying to connect a database to some fields on an aspx webform on my website. i tried the above code but guess i am having problems with setting the "Initial Catalog" value. How do i specify a separate sql database file?
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Start SQL Configuration Manager and make sure that Name Pipes is enable under Client Protocols. Let me know if that does the trick for you. Thx for watching.
Try this: SQL Server Surface Area Configuration -> Click on Surface Area Config. for Services and Connections -> Click on Remote Connections -> Click on Using both TCP/IP and named pipes -> Apply/OK -> Click on Service right above it -> Stop and Start Service -> Apply/OK -> Happy Coding!!!
@manojssu2000 In data source you need to add the name of your sql server: Data source=MANOJ-PC/SQLEXPRESS, if it gives you an error try adding the fields user="" and password="" and remove integrated security
This Tutorial ROCKS! I am taking a series of classes at collage to learn the stages of what this video just showed. Bablio, you are my Database Guru...You need a donation box on your website!
hi...during the connection it is showing an error in cs.open(),, ( An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.)
Start SQL configuration Manager and make sure that Share Memory. Name Pipes and TCP/IP are all enable, under Client Protocols... I think that would solve your problem.
Hi there!! Id like to thank you alot for this video.. Ive been working on this for a month and only your video tutorial gave the perfect solution!! Thank you so much!!!
good lesson! ; )
rmas199 3 weeks ago in playlist Favorite videos
Great Friend I just wanted to know That..Thanks a A lot Bro.. Send me your email..
OxMATHEMATICS 3 weeks ago
Great Videos!!! I made my whole project just by watching your Videos!! Bundles of Thanks!! Keep up the great work!!!
sohaiby999 1 month ago
man, you rule....great knowledge :) thanks, your videos helped me a looooot ...
baturanija1 1 month ago
The messageBox comes up but i cannot continue inserting, the code i originally have is
void insert() { String FirstName = "";
alan10014 2 months ago
This has been flagged as spam show
First of all bro thank you very much for these exellent tutorials, here is one simple question if you leave txtFirstName empty and try inserting data it will give an error "Input string was not in a correct format.", what could we put so that it simply shows a messagebox diplaying that we need to enter field, click OK and continue inserting, i tried:
if (txtFirstName.Text.Trim() == "") MessageBox.Show("Missing FirstName.");
FirstName = "'" + this.txtFirstName.Text + "'";
alan10014 2 months ago
Comment removed
alan10014 2 months ago
Comment removed
alan10014 2 months ago
Comment removed
alan10014 2 months ago
This has been flagged as spam show
can i have your source code? please so I can study it well please
just contact me sir at tishamalunes@gmail.com
i really need those for our project.
17chronic 3 months ago
please search code by date or /and name and date and results display in dg.
if you please man.
mhassan083 4 months ago in playlist Visual Studio C#
mooooooooooooore thanks maaaaaaaaaaan
mhassan083 4 months ago in playlist Visual Studio C#
Hey..thanks man.Done part 1.And on to the next.....
glycerin3 4 months ago
After 5 hours of trying finally found a great video series...Thank you very much
lpjanaka 4 months ago
This has been flagged as spam show
Can you use update button multiple times when the program is running?
I couldn't because of error " --- variable @FIRSTNAME already declared".
and after I changed my code, InsertCommand.Parameters.add(" ") and other Parameters.Add lines put in Form1() constructor, as it happens only once.
and the button1_Click() method code changed sth like that: "InsertCommand.Parameters["@Firstname"].Value=txtbox.Text." - it worked :)
arabuli91 4 months ago
Comment removed
arabuli91 4 months ago
Comment removed
arabuli91 4 months ago
nice....nice
vry nice men thanks..........
spvadha 4 months ago
Hey Dude!
i watched all 5 parts but i wana know how to search a record in the database
i want to search a record from my app which is made in c#
mub08 4 months ago
I got an error and it says
it was on da.InsertCommand.ExecuteNonQuery();
Incorrect syntax near '@LASTNAME'.
how do i solve this?
aishapotness 4 months ago
Thanks a lot for your kind help, i have some questions did MS SQL accept movies? i mean i create a website such as Youtube as an example depend on MS SQL? and how i can do that?
FFares2011 5 months ago
Plz i need help i want to know How to Retrieve the Identity Value While Inserting Records??? i want insert data on 2 tables. thanks??
dilinger123 5 months ago
Comment removed
dilinger123 5 months ago
You are amazing, thank you!
NyorexDC 5 months ago
Superb video. you have taught me so much! Can you recommend the best book to buy if you are a beginner?
TheGreglad 6 months ago
GREAT .. thanks :)
0ElectroMad0 6 months ago
I would like to thank you so much for your enthusiastic and clear explanation of manipulating data using sql & c#. Like MariKotvanova I was so frustrated with not being able to fully comprehend the information on the MSDN website. The challenge seemed enormous. By you generously passing on the information has greatly improved my circumstances at college and more importantly my understanding of sqlserver and c#. Thank you so much and hope you continue this good work.
MrBarrack1 7 months ago
HEY, ur presentations is good, so i was thinking if you could make a series of tuts on c# and asp.net then it would be like, totally awesome :)
anujkaithwas 7 months ago
HEY, ur presentations is good, so i was thinking if you could make a series of tuts on c# and asp.net then it would be like, totally awesome :)
anujkaithwas 7 months ago
thank you so much for your videos! you can't even imagine how helpful they were for me) i passed my course project on writing database only with your help! just couple days ago i was completly frustrated, cause i had no idea how to do that, and google couldn't help
but than i found you,
thanks a lot again for your work )))
MariKotvanova 7 months ago
Parabens, seu video aula ficou muito legal!
milaengenheira 7 months ago
Hi
This is really interesting stuff. But who does it work with auto-incremented fields of your database as ID's and so. What value do you set in your parameter?
Many thanks for your reply.
verhaba 8 months ago
Comment removed
verhaba 8 months ago
this cannot be done in a normal class? :/
RiKKuXd28 9 months ago
I love your videos!. Thank you very much for your time. They are really helpful.
malganjn1 9 months ago
@BablioBr
Can you make a video that show us how do like when we make an update to the database, the other client also aware of the update in the database application. thankssss
lehungquoc 9 months ago
Couple of things: First .. "...Data Source=.\\SQLEXPRESS;..." 2 backslashes? Try ".\SQLEXPRESS" instead of ".\\SQLEXPRESS" Second: "; Integrated Security=TRUE");" means that Windows Authorization is enabled.. perhaps you need to enter the SQl user name and password... Try using this instead of "Integrated Security=TRUE": ";User Id=myUsername;Password=myPassword;" I hope this helps.. good luck.
BablioBr 9 months ago
@BablioBr What if i have a table Student and want a field that displays student picture in a pictureBox (and also be able to browse image files and change it), StudentID could be foreign key of ImageDB table (assuming we have Student and ImageDB tables separate) and somehow find a way so that when selecting a specific row from datagrid pictureBox gets updated with image linked to that StudentID
alan10014 2 months ago
@BablioBr my IDE would just tell me \ is an unrecognized escape sequence :(
carlnathan 2 weeks ago
Fabio, would you help me? I'm trying to access my SQL Database but every time I try, I receive this message: "Login failed for this user". I am working on a project and I need to solve this ASAP. Here is the code:
sqlConnection cs = sqlConnection("Data Source=.\\SQLEXPRESS; Initial Catalog=MyDatabase#4; Integrated Security=TRUE");
cs.Open();
MessageBox.Show(cs.State.ToString());
cs.Close();
fabioov 9 months ago
Fabio, could you help me? I'm trying to access my SQL Database but every time I try, I receive this message: "Login failed for this user". I am working on a project and I need to solve this ASAP. Here is the code:
sqlConnection cs = sqlConnection("Data Source=.\\SQLEXPRESS; Initial Catalog=MyDatabase#4; Integrated Security=TRUE");
cs.Open();
MessageBox.Show(cs.State.ToString());
cs.Close();
fabioov 9 months ago
I came back and rated right after I saw your video "Part 5 of 5: Deleting Data from SQL using SqlDataAdapter and the DeleteCommand with C# ", which I don't usually do that I have to, cuz the quality of your tutorials are so simple to understand and so useful. keep posting your hard works, plx, thx....
rong111y 9 months ago
hey can you make the same with vb.net ?..pls....im not able to understand this....pls help me!..have to finish my project
yashubhagat 10 months ago
Nevermind about my previous post, I've conduct an experiment for 6hrs+ and my SQL 2005 is now working and now...
I've finished your part 1 of 5 video :D
Next One Part 2!! XD
VigilianceAurelious 10 months ago
Comment removed
VigilianceAurelious 10 months ago
You're a life saver. But don't you have a website where we can download your files, sample programs, etc? That would really be helpful. Thanks so much! :)
TheIris00000 10 months ago
You changed my life! Thanks!
videotek24 10 months ago
Very good. Do you have menu that disables if the connection to database is not successful?
airbus380pilot 10 months ago
Great tutorials. Thanks.
nEdImTT 11 months ago
thanks
wcl5195 11 months ago
Thank for tutorial from thailand
innomaster1 11 months ago
I have a question.
Note: I use sqlceconnection.
why when i use the code in this example, i get : "The number of columns in the query and the table must match. [ Number of columns in query = 2, Number of columns in table = 3 ]" .
Note 2: table has id, name, date ; I use insertcommand for name and date, so i guess it "wants" something for id; cand anyone help me?
danielkro1 11 months ago
Nice tutorial!
danielkro1 11 months ago
Great tutorial! I have a question in connection string. What connection string I will be used if I will make my application with network database as an installer?
mryeah07 11 months ago
Best tutorials ever! Thank you!
dits05 1 year ago
hi Bablio i cant connect to my sqlserver express using this.. are there no difference between server and server express regarding the connection string / syntax? thanks
carlnathan 1 year ago
this is one of the best tutorial for database connection. I am working on visusal web developer. IN my project web application which has check boxes. Can you please tell me how to define and retrieve data for checkbox ?
Thank you so much for being so helpful in this video!
archies34 1 year ago
Thank you BablioBr. Very good and clean tutorial. I successfuly connected to my sql server.
m1tnik 1 year ago
Fabio! you are great, simply and the right way to make one thing that seems to be a headache... thanks a lot!
arperdomoh 1 year ago
I'm from Colombia dude, you deserve to be called MY SENSEI
Easy and Perfect.
Johanlegnar 1 year ago
Hi, just finished your 1-5 tutorial but got an error in this video. I get an error when it reaches "da.InsertCommand.ExecuteNonQuery();" it says
"Column name or number of supplied values does not match table definition."
Tried everything but to no avail. the lesson 2 to 5 were done except for this.
karlinoDS 1 year ago
@karlinoDS Without looking at you code, my best guess is that your ID column is the problem. "Column name or number of supplied values does not match table definition. "Column name" - make sure your INSERT sql has the right syntax.. correct spelling of the column names. "Number of supplied values does not match table definition" - make sure you are passing all value to all column.
BablioBr 1 year ago
@karlinoDS In regards to the ID column in SQL make sure it has this specifications: Identity Specification: Yes; (is Identity): Yes; Identity Increment :1; Identity Seed: 1; I hope this will help.
BablioBr 1 year ago
@BablioBr Hi, forgot to tell you that i did all you said above;
danielkro1 11 months ago
This has been flagged as spam show
@bablioBr
aww thankioo its
adp_900@hotmail.com
xabah1 1 year ago
This has been flagged as spam show
aww thankioo its
adp_900@hotmail.com
xabah1 1 year ago
This has been flagged as spam show
aww thankioo its
adp_900@hotmail.com
xabah1 1 year ago
Need help
Im getting a error
"An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll Additional information: System error."
Im using VS 2003
Please Help Im a beginner
hpjperera 1 year ago
reply me urgent i need to cmplete my project soon :(
xabah1 1 year ago
@xabah1 Send me your email.. I'll get in touch with you today. Thx for watching
BablioBr 1 year ago
This has been flagged as spam show
@BablioBr aww thankioo its
adp_900@hotmail.com
xabah1 1 year ago
This has been flagged as spam show
@BablioBr
aww thankioo its
adp_900@hotmail.com
xabah1 1 year ago
This has been flagged as spam show
@BablioBr
aww thankioo its
adp_900@hotmail.com
xabah1 1 year ago
This has been flagged as spam show
@BablioBr
aww thankioo its
adp_900@hotmail.com
xabah1 1 year ago
This has been flagged as spam show
@BablioBr
aww thankioo its
adp_900@hotmail.com
xabah1 1 year ago
@BablioBr
i sent u request at fabio.scopel is dat....!!!
thankioo
xabah1 1 year ago
@BablioBr
I was wondering. I'm making a simple form that inserts data into a single table with a stored procedure. Normally, this wouldn't be hard, except for one problem. One column uses a type of encryption, so to insert, I would have to first declare a password, then insert the data.
Here's an example:
insert into user (firstname, number, cardnumber)
values('john', '123', EncryptByPassPhrase('123', '450012'))
How would one insert this data through C# using a stored procedure? :o
ThePieIsLie 10 months ago
hi fabio ....need a help
i heard ur lecture 1 several tyms ... bt every tym i m getting into the sanme problem
kst when i click add record its execution break at the instruction
da.InsertCommand.ExecuteNonQuery();
y dosnt is execute in my prog...........whts the prblem reply
thankioo
xabah1 1 year ago
Hi Fabio. Help me please! Your tutorials online have been so helpful. I wouldn't have gotten this far this semester without your videos, but I'm running into a problem adding an existing database using Visual Studios. I'm trying to add new data to the database and then display the new information with the old data our professor has added already to the database.
romeerome2000 1 year ago
Cheers Bablio - you have explained this very clearly.
supercoolman1977 1 year ago
Hello Fabio. I only signed up to youtube membership to tell how great your tutorials are, and how they are saving students' lives around the world. Thank you ever so much for making such a generous effort solely for the benefit of others, please keep this up, and make lots of fans (like me) round the globe everyday. God bless.
tanvirctg 1 year ago
@tanvirctg Wow, that s really nice and interresting comment. First of all thank you. Secondly I trully started this series, because as I was in school I noticed a huge lack of informatoin in this specific area. I'm glad it helped you. Stay tuned, I am starting a series in delegates.. I will be posting it soon. Also check out our group on facebook, " Learn C# - The Right Way ".
BablioBr 1 year ago
Error 1 Unable to copy file "obj\Release\WiimoteWhiteboard v0.3.exe" to "bin\Release\WiimoteWhiteboard v0.3.exe". The process cannot access the file 'bin\Release\WiimoteWhiteboard v0.3.exe' because it is being used by another process. WiimoteWhiteboard
sha31337 1 year ago
Awesome :) Thank you very much.
jasonmh 1 year ago
Hey i am getting an error on this line
da.InsertCommand.ExecuteNonQuery();
Pls help
viteshshah1107 1 year ago
hi thank you this a very clear and help full video cant wait to see more from u the only problem is that my connection string is not working but im sure ill figure it out but thanks for the good work wish there was more people like you making tutorials u make it easy to understand .
aardvarklion 1 year ago
Thanx Fabio, i'm semi Pro in C# but this video Tuto is very clear and easy to learn for da Newbies.
icebergdelphi 1 year ago
thanks pabel you explain very nice good luck
erezr1234 1 year ago
really this worked dear.......thank u very much..may god bless u..
shahikkk 1 year ago
Thanks. I have plenty of books around but nothing like a video tutorial to cut through all the bs and just get to the heart of it.
mtsimmons419 1 year ago
it runs ok but no data is written to the table
bahot454 1 year ago
Comment removed
bahot454 1 year ago
This has been flagged as spam show
i have the same problem
"
wooooow, its really a great job ! well done..
I tried to execute the code u gave but when i execute it , it gives me the error associate with the (da.InsertCommand.ExecuteNonQu ery();)..
"
and i followed your steps for the config but it still doesnt work
please help me
btw nice videos :-)
giouri1983 1 year ago
verga ahora no me jala la execute -.-
MeXRochi 1 year ago
we gracias ""
NO Me jaalba porue le faltaba poner una exepcion
y tmb el nombre de la computaroa en datasource , le agregue \\SQLEXPRESS Y LISTO juajua!!
THX ^^
MeXRochi 1 year ago
hey thanx for the great videos you put on show.............
could you please tell how to use flash, swf files in .net
shreyshukla1 1 year ago
Great Tutorial!!!!
Rasputin881122 1 year ago
Thanks man, this is a great tutorial!!!!
Rasputin881122 1 year ago
This has been flagged as spam show
Hi, Thanks for this helpful video but I am getting 2 errors at da.InsertCommand.Parameters.Add("@FIRSTNAME", SqlDbType.VarChar).Value =txtFirstName.Text; da.InsertCommand.Parameters.Add("@LASTNAME", SqlDbType.VarChar).Value = txtLastName.Text;
1) it is saying the txtFirstName doesn't exist in current context
2) same with last name.
Pls help.
harshay9 1 year ago
Hi, Thanks for this helpful video but I am getting 2 errors at da.InsertCommand.Parameters.Add("@FIRSTNAME", SqlDbType.VarChar).Value =txtFirstName.Text; da.InsertCommand.Parameters.Add("@LASTNAME", SqlDbType.VarChar).Value = txtLastName.Text;
1) it is saying the txtFirstName doesn't exist in current context
2) same with last name.
Pls help.
harshay9 1 year ago
SqlConnection cs = new SqlConnection(@"Data Source=.\SQLEXPRESS; Initial Catalog=Youtube; Integrated Security=True");
works
haryiips07 1 year ago
Named Pipes Provider, error: 40 - Could not open a connection to SQL Server
thats what happens when cs connection tries to connect to the database :S help!!
tranceloop 1 year ago
loved you vids thanx for uploading.
can you please also upload some tutorials on how to connect databases using ASP.net and C# .
i need a tutorial on the same application in your video but using ASPx page.
Thanks
meeaamir 1 year ago
Dude, I loved your video.
astronivo20XX 1 year ago
hi ur videos r amazing...
i want to know more about SQL
tushzaware 1 year ago
plz make a video to insert primary and foreign key data in sql server 2005 through text box using C#.net
gamerboy19881 1 year ago
now it works even with this command: "Data Source=.\\SQLEXPRESS; Initial Catalog=MyDataBaseRealName; Integrated Security=TRUE"
some tutorials on the web recommend to set auto close to true in mssms, but even without that works excellent ;-)
StevaManStevaMan 1 year ago
i have success to make a database app using the way in video, but i fail to running app again when i transfer all the file to another computer. how to solve this problem so i can use it om my computer and another computer?
vancelam 1 year ago
hey thx a lot for this, it's exactly what I needed!
xdocek 1 year ago
i use Properties.Settings.Default.sqlConnectionStringByMe instead code between "" in this example
sqlConnectionStringByMe is manually created from properties/settings type: connection string; scope: application; value: location on hard drive.
StevaManStevaMan 1 year ago
thanks a lot !
wilayafr 1 year ago
Nos acabas de salvar la vida frikillo! que dios te lo pague con una espada +4 a la destreza
snakingmax 1 year ago
I keep getting the error
"Must declar the scalar variable @"
my code is exactly the same as yours.
Fiziks07 1 year ago
hey guys, if some of you have the problem with connecting to sql, just use this code, it works for sure: SqlConnection cs = new SqlConnection(@"server = .\sqlexpress; integrated security = true;database = youtube");
edd4u2 1 year ago
awesome video.thanks for posting
rajeshkota 1 year ago
Sabroso, just what I was looking for....
thanks man
doton2006 1 year ago
the connection string sintax that you wrote doesn't work for me.
in fact the only one that works is the one that i obtained from DATA->Add new data source-> database-> new....
Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True
i bothers me that it's really long, and uses the physical addres of the file :)
montrazvan89 1 year ago
add me on Messenger Live : fabio.scopel at hotmail I'll answer your question there
BablioBr 1 year ago
u are awsome!!!
HistoryStudio 1 year ago
This has been flagged as spam show
hey guys, i am trying to connect a database to some fields on an aspx webform on my website. i tried the above code but guess i am having problems with setting the "Initial Catalog" value. How do i specify a separate sql database file?
BTW i am using sql 2000
optimus2290 1 year ago
Comment removed
optimus2290 1 year ago
Comment removed
optimus2290 1 year ago
when i test da connection this exception occurs
tel me wat i hav done wrong
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
manojssu2000 1 year ago
Start SQL Configuration Manager and make sure that Name Pipes is enable under Client Protocols. Let me know if that does the trick for you. Thx for watching.
BablioBr 1 year ago
i have done it
doenst work
here is the code private void btnAdd_Click(object sender, EventArgs e) { SqlConnection cs = new SqlConnection("Data Source= SQLEXPRESS; Initial Catalog=empbase ; Integrated Security =True"); cs.Open(); MessageBox.Show(cs.State.ToString()); cs.Close(); }
but my sql server name is MANOJ-PC/SQLEXPRESS
manojssu2000 1 year ago
Try this: SQL Server Surface Area Configuration -> Click on Surface Area Config. for Services and Connections -> Click on Remote Connections -> Click on Using both TCP/IP and named pipes -> Apply/OK -> Click on Service right above it -> Stop and Start Service -> Apply/OK -> Happy Coding!!!
BablioBr 1 year ago
@manojssu2000 In data source you need to add the name of your sql server: Data source=MANOJ-PC/SQLEXPRESS, if it gives you an error try adding the fields user="" and password="" and remove integrated security
tlatoani3 1 year ago
This Tutorial ROCKS! I am taking a series of classes at collage to learn the stages of what this video just showed. Bablio, you are my Database Guru...You need a donation box on your website!
leason22 2 years ago
hi...during the connection it is showing an error in cs.open(),, ( An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.)
dammyram 2 years ago
Start SQL configuration Manager and make sure that Share Memory. Name Pipes and TCP/IP are all enable, under Client Protocols... I think that would solve your problem.
BablioBr 1 year ago
Easy to understand clear example, Thank you for your efforts man you're doing excellent work! keep up the good work thanks.
veepware 2 years ago
You're videos are great. Thanks so much
funnyinga 2 years ago
Hi there!! Id like to thank you alot for this video.. Ive been working on this for a month and only your video tutorial gave the perfect solution!! Thank you so much!!!
JaRhiL0ve2 2 years ago
This has been flagged as spam show
wooooow, its really a great job ! well done..
I tried to execute the code u gave but when i execute it , it gives me the error associate with the (da.InsertCommand.ExecuteNonQuery();)..
Please, can you help me !
sdmlight 2 years ago
wooooow, its really a great job ! well done..
I tried to execute the code u gave but when i execute it , it gives me the error associate with the (da.InsertCommand.ExecuteNonQuery();)..
Please, can you help me !
sdmlight 2 years ago
Comment removed
bahot454 1 year ago
best.tutorial.ever
xleo21 2 years ago
very nice and clear explain thank you so much for this tut i like it to much
farahmand2000 2 years ago
Great, very useful to me... Thank you very much
dave1x1 2 years ago
Thank you for watching.
BablioBr 2 years ago