|
Thanks.
I have changed it but it is still throwing the same exception.
|
|
|
|
|
Hi, i am currently trying to get to grips with creating a data table in VB.Net (visual studio 2003), however after creating the schema, I try to creat the data table but as soon as I conect the schema to the xml file I get an error report stating the schema does not support the root function
I have very little knoledge about this and I am just learning the language, please can anyone help?
Thank you.
|
|
|
|
|
JonCox wrote: I try to creat the data table but as soon as I conect the schema to the xml file
What do you mean by this?? Did you already have an XML file and then try and create a schema to match it??
|
|
|
|
|
Look...i'm really not good with sql since i don't do it that often...can someone please give me a really dumbed down answer so i understand. I am sorta just getting into using sql.
How do i check if a record exists, i need to know everything, i have a table called users. When a user puts a username in a textbox, how do i check if a record exists with there user name.
|
|
|
|
|
just put it in the where clause and check if you get a record back:
sql: select username from users where username='me'
then you just check you'r datareader/adapter if there is a record in it
if so the user exist of not the user doesn't exist
hope this helps
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
i appreciate the help, but i am not at all database experienced and to me this is extremely vague, i'm seriously like a lost sheep when it comes to this, you need to be really detailed for me. thanks though.
|
|
|
|
|
HI The ANZAC
Follow me. Lets say i have a textbox in my form and i want to see if there is a user name that Exist in my table "Users", and am using VB.NET. the First thing is to set up the adapter. you must tell the adapter that you going to Accept inputs from users. e.g
SELECT USERS FROM MYTABLE WHERE (USERNAME = @USERNAME)
When you are done with that create a dataset and Fill your dataset with Data like this.
myadapter.Fill(mydataset)
After that , you need to call this from your form.
in your form put in a Button , call it "btnSearch", and in the button click event write the Following code.
try
myadapter.SelectCommand.Parameters("@Username").Value = txtUsername.Text
mydataset.Clear()
myadapter.Fill( mydataset, "MYTable")
If mydataset.Tables("MYTable").Rows.Count = 0 Then
MessageBox.Show("The USERNAME does not Exist in the Database you can Continue Add it", "Info", MessageBoxButtons.OK)
Else
MessageBox.Show("The Property Exist in the Database, you cannot Add this liskey", "Error", MessageBoxButtons.OK)
End If
Catch ex As SqlClient.SqlException
MessageBox.Show(ex.Message)
End Try
Hope this Helps, if doesnt TEll me
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
This is helping, but where do i put that select statement, i am really new to this.
|
|
|
|
|
i suggest you use the Wizard for now, as you are new. drag an Adapter from your ToolBox, The wizard will popin and Click next, if you have no Connection create a new one, if you are using Access as a Backend choose JET4 provider and select where the database is and test the connection. after that right click on the adapter and choose Configure the adapter --> and you will see that database had been selected and click next-->:Choose the First Opttion "Use SQl statement", ---> Next this Part its where you put your SQL statement, after that you will click next, all neccessary command statement will be generated for Update, select and Delete and Click Finish
hope it Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
This has helped. I managed to do it slightly different..in that it counts the amount of users which have the same name as the above.
select count(*)
|
|
|
|
|
AM Glad i helped you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I am developing a windows application in VB.Net 2005.
In this I want to send mail to my gmail id.
And also if I receive mail on my gmail account then it should be displayed in my application.
Firstly tell me how to send mail to any e-mail ID through my windows application.
In short I want functionality of Outlook Express in my application means in Outlook Express we can configure our gmail or yahoo account in similar way I want to configure my gmail account into my windows application.
Please tell me how to do this?
|
|
|
|
|
study system.web.mail library deeply. it is simple to send mails
Salman Sheikh
|
|
|
|
|
I think this link[^] has an answer for you.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
hey Steven,
i tried the code given by you as follows -
Dim myMessage As New System.Net.Mail.MailMessage()
With myMessage
.To.Add("harshal_shravgi@gmail.com")
.From = New System.Net.Mail.MailAddress("harshal_shravgi@yahoo.com", "Harshal")
.Subject = "Test For Sending Mail"
'.Attachments.Add(New System.Net.Mail.Attachment("path of attachment here"))
.Body = "Hi hello How are U?"
.IsBodyHtml = False
End With
Dim SmtpMail As New System.Net.Mail.SmtpClient
With SmtpMail
.Host = "smtp.gmail.com"
.DeliveryMethod = SmtpDeliveryMethod.Network
'Credentials only required if your SMTP server requires User Name and Password
.Credentials = New System.Net.NetworkCredential("harshal@veda-logic.com", "board8414")
.Send(myMessage)
End With
But got error as -
The SMTP server requires a secure connection or the client was not authenticated. The server response was:
5.7.0 Must issue a STARTTLS command first m34sm543278waf
|
|
|
|
|
I did it using my gmail account as follows -
Dim myMessage As New System.Net.Mail.MailMessage()
With myMessage
.To.Add("harshal_shravgi@rediffmail.com")
.CC.Add("ashish@veda-logic.com")
.From = New System.Net.Mail.MailAddress("harshal.shravgi@gmail.com", "Harshal")
.Subject = "Test at " & Now
.Attachments.Add(New System.Net.Mail.Attachment("C:\Documents and Settings\x\Desktop\code.txt"))
.Body = "Hi hello How are U?"
.IsBodyHtml = False
End With
Dim SmtpMail As New System.Net.Mail.SmtpClient
With SmtpMail
.Host = "smtp.gmail.com"
.DeliveryMethod = SmtpDeliveryMethod.Network
.Credentials = New System.Net.NetworkCredential("harshal.shravgi@gmail.com", "pochhi")
.EnableSsl = True
.Timeout = 10
.Port = 25
.Send(myMessage)
End With
MessageBox.Show("Message Sent")
Now tell me how to receive mails same as we do it in Outlook Express
|
|
|
|
|
Asalam-O-Alikum!
what is the easiest way to insert data from one DataBase table to an other database table with same structure or same schema.
Reagards.
B asharatA li
Internee
METESYS Lahore
Pakistan
|
|
|
|
|
find info about DTS (Data Transformation Service) about the DBMS you are using. It is not difficult
Salman Sheikh
|
|
|
|
|
Thx for ur time
but i want to do this throug vb code at run time when user press a button.
Regards
B asharatA li
Internee
METESYS Lahore
Pakistan
|
|
|
|
|
I need to run a DOS process application and get the final ErrorLevel.
Three questions:
a) How can i execute from Vb.net
a) How can i get the final ErrorLevel.
b) Is possible to redirect output stream data process to a form on my applicacion.
regards
|
|
|
|
|
Hi,
have a look at the Process class.
You will be interested in the Start() method, the ExitCode property, and others as well.
And there are plenty of examples here on CodeProject.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hai,
I have tried to use 3 layers
Presentation Layer,business Logic Layer, Data Access Layer
Just i Have tried,tell whether this is correct or not?
In My Presentation Layer[tUserPL.aspx]
i have two textbox one for UserName and other for password
<code>
Dim i As String
Dim UserBLL As New UserBLL
Private Sub btnSubmit_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.ServerClick
Try
UserBLL.User_Name = Me.txtuser.Value
UserBLL.User_Pass = Me.txtPass.Value
i = UserBLL.Verify()
If i > 1 Then
Response.Redirect("\IPB\tBillCorrectionA.aspx")
Else
Response.Write("Not an Authorized User")
End If
Catch ex As Exception
Response.Write(ex.Message.ToString())
End Try
End Sub
</code>
In My business Logic Layer[UserBLL.aspx] i Have the Following,
<code>
Public Class UserBLL
Public err, cmd_value, qry_value As String
Dim UserData As New UserDAL
Dim sqlconn As New SqlClient.SqlConnection
Public Property User_Name() As String
Get
Return cmd_value
End Get
Set(ByVal Value As String)
cmd_value = Value
End Set
End Property
Public Property User_Pass() As String
Get
Return qry_value
End Get
Set(ByVal Value As String)
qry_value = Value
End Set
End Property
Public Function Verify()
Dim sqlcmd As SqlClient.SqlCommand
Dim i As Integer
Me.sqlconn.ConnectionString = ConfigurationSettings.AppSettings("BB_CONSTR")
Me.sqlconn.Open()
Return UserData.ExecuteMsgQuery("select count(*) from mast_users where cLogin like '" & User_Name & "' and cPassword like '" & User_Pass & "'", sqlconn)
End Function
End Class
</code>
In My Data Access Layer[UserDAL.aspx] i Have following
<code>
Public Class UserDAL
Public Shared Function ExecuteMsgQuery(ByVal selQuery As String, ByVal myCon As SqlClient.SqlConnection) As Int16
Try
Dim SqlAdpt As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(selQuery, myCon)
If SqlAdpt.SelectCommand.ExecuteScalar > 0 Then
Return 2
Else
Return 1
End If
Catch ex As Exception
Return 3
Finally
End Try
End Function
</code>
In above i have tried to get a concept but i think i am not in correct way and
i need a result like verfying the user name and password and return back to BLL
i am not getting any error and i am redirecting to another page after verifying user name and password. after i am getting correct as result i need to proceed the same concept in my project. help me out...
sathimailin
|
|
|
|
|
hi , i have a Written a nice for Beginners.
http://www.codeproject.com/useritems/N-Tier_Application.asp[^]
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
for ex,
there are 2 datetimepicker,1 textbox,1 button named as firstdatetimepicker,seconddatetimepicker,noofdaystextbox and okbutton.
calculation is
seconddatetimepicker = firstdatetimepicker + noofdaystextbox.
example-1
if i give date to firstdatetimepicker is "22-10-2007" and i give no of days to noofdaystextbox is 4,then i click ok button means,must add 4 days from "22-10-2007",in seconddatetimepicker must automatically displayed as "26-10-2007"
example-2
if i give date to firstdatetimepicker is "15-10-2007" and i give no of days to noofdaystextbox is 9,then i click ok button means,in seconddatetimepicker must automatically displayed as "24-10-2007"
i do my project in .net 2005 windows application.i want in .net windows application.
|
|
|
|
|
It's very simple. Convert the string in the textbox to a number (for example using Int32.TryParse), then use the AddDays method on the date to create a new date with the days added.
---
single minded; short sighted; long gone;
|
|
|
|