C# MySQL insert data issue

Закрито Опубліковано %project.relative_time Оплачується при отриманні
Закрито Оплачується при отриманні

I am currently having an issue in inserting data into the MySQL database. Our code inserts null values when the form is submitted with no errors. This is the first time we are working with MySQL for the first time. We usually work with SQL Server and it works with no problems.

We need some one to look into why it is entering in null values.

Please see the script below and see if we are doing wrong.

string insertSQL;

insertSQL = "INSERT INTO vendors (";

insertSQL += "fname,";

insertSQL += "lname,";

insertSQL += "company_name,";

insertSQL += "address_1,";

insertSQL += "address_2,";

insertSQL += "city,";

insertSQL += "state_id,";

insertSQL += "postal_code,";

insertSQL += "phone,";

insertSQL += "fax,";

insertSQL += "email,";

insertSQL += "web_url,";

insertSQL += "password,";

insertSQL += "active,";

insertSQL += "status,";

insertSQL += "date_entered) ";

insertSQL += "VALUES (";

insertSQL += "@fname,";

insertSQL += "@lname,";

insertSQL += "@company_name,";

insertSQL += "@address_1,";

insertSQL += "@address_2,";

insertSQL += "@city,";

insertSQL += "@state_id,";

insertSQL += "@postal_code,";

insertSQL += "@phone,";

insertSQL += "@fax,";

insertSQL += "@email,";

insertSQL += "@web_url,";

insertSQL += "@password,";

insertSQL += "@active,";

insertSQL += "@status,";

insertSQL += "NOW());";

insertSQL += " SELECT last_insert_id()";

MySqlConnection connection = null;

try

{

connection = new MySqlConnection([login to view URL]["DataBaseConnection"].ToString());

[login to view URL]();

MySqlCommand cmd = new MySqlCommand();

[login to view URL] = connection;

[login to view URL] = insertSQL;

[login to view URL]();

[login to view URL]("@fname", fname);

[login to view URL]("@lname", lname);

[login to view URL]("@company_name", company_name);

[login to view URL]("@address_1", address_1);

[login to view URL]("@address_2", address_2);

[login to view URL]("@city", city);

[login to view URL]("@state_id", state);

[login to view URL]("@postal_code", postal_code);

[login to view URL]("@phone", phone);

[login to view URL]("@fax", fax);

[login to view URL]("@email", company_email);

[login to view URL]("@web_url", website_url);

[login to view URL]("@password", company_name);

[login to view URL]("@active", 1);

[login to view URL]("@status", 1);

int id = [login to view URL]([login to view URL]());

[login to view URL](id);

}

finally

{

if (connection != null)

[login to view URL]();

}

.NET Програмування на C# MySQL SQL

ID Проекту: #9232020

Про проект

45 заявок(-ки) Дистанційний проект Остання активність Feb 12, 2016

45 фрілансерів(-и) готові виконати цю роботу у середньому за $23

rinsadsl

Hello Good Day We can help you on this project. We have worked a lot with .net and mysql. Looking forward to hear from you. Thanks Rinsad

$24 USD за 0 дні(-в)
(711 відгуків(и))
9.0
abugosia

A proposal has not yet been provided

$30 USD за 1 день
(186 відгуків(и))
6.9
gkalish

I worked lot of projects n mysql and willing to fix the issue within 30 minutes .

$30 USD за 1 день
(226 відгуків(и))
6.7
zuiguanglong

Hi, Yes. C# is my SKILL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I have already find your issue Let's build success!!! Thank you for your time and consideration.

$24 USD за 1 день
(40 відгуків(и))
6.0
nikmah344

Hello, I have read through the job details extremely carefully and I am absolutely sure that I can do the project very well. I am having 6+ years of experience in Web Development. I have worked on below technologie Більше

$25 USD за 1 день
(37 відгуків(и))
5.9
sunny945

Hi ! i am a professional c# and database developer and mysql Expert. i want to work on your project. i can debug and complete this in no time

$10 USD за 1 день
(54 відгуків(и))
5.3
bilal78699

Hi, I'm expert in C#, MySQL and many other technologies, just send me your code or lets have a teamviewer session. I need to figure out where is the issue. It will be done right away during the session. Thanks, Більше

$10 USD за 0 дні(-в)
(11 відгуків(и))
5.1
ahmednayl12345

Hello sir i can login in now with team viewer and solve it plz message me to start now thanks ahmed nayl

$15 USD за 1 день
(16 відгуків(и))
4.8
HealthyCoder

Hello Sir, Being a Software Engineer i can do your job easily, i have 3 years experience with C# desktop application development, come to chat for detail conversation about your project. Regards Sibghat Ullah

$15 USD за 1 день
(14 відгуків(и))
4.5
ashupathania

I have 4 + years of experience in MSBI Technology(SQL Server 2008/2012) Worked with the reputed clients like Microsoft and Dick Sporting goods. Worked with the Huge datasets , Query optimization,Execution plans ,SSI Більше

$30 USD за 1 день
(23 відгуків(и))
4.8
softtechsurat

Hello sir/madam, we have read and understand your requirement and very much confident that we can complete this project within low budget and less time . Give us chance to serve you better... Thanks & Regards, Більше

$24 USD за 1 день
(18 відгуків(и))
4.2
zealoustech15

A proposal has not yet been provided

$10 USD за 1 день
(10 відгуків(и))
3.4
singharun171287

A proposal has not yet been provided

$20 USD за 2 дні(-в)
(8 відгуків(и))
3.2
ratheeshkumar1

.Net Developer With 6 years of development experience in Microsoft technologies! My core expertise is in developing and designing web applications and distributed software. I have worked extensively on MVC, , and Більше

$20 USD за 1 день
(2 відгуків(и))
2.7
habeeb83

A proposal has not yet been provided

$25 USD за 1 день
(1 відгук)
2.4
matash23

Good afternoon, I'm looking forward to contact me and start a collaboration with long-term effect, hopefully with great results.I have a strong experience in C# /ASP. NET / MySQL as I have been working in these areas f Більше

$10 USD за 1 день
(2 відгуків(и))
2.0
KERConsultancy

-- why you are doing it with inline query and not store procedure? -- even if you want to do with inline query, i don't think so it's neat. -- there could be many reasons for this error, so better to discuss in chat Більше

$15 USD за 1 день
(4 відгуків(и))
1.9
remonengineer

Hi. I have a good experience in c# and my sql database. Regards,

$10 USD за 1 день
(1 відгук)
2.8
MabroukHarabi

A proposal has not yet been provided

$25 USD за 0 дні(-в)
(1 відгук)
1.0
visualorborlandc

Hy there I have seen your code you people are using wrong syntax. For further discussion please add me on skype:- sheheryar_25 Regard's Sheheryar

$25 USD за 1 день
(0 відгуків(и))
0.0